Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Hangs when pnpm install at postinstall #27056

Closed
justnewbee opened this issue Jul 23, 2024 · 13 comments
Closed

Hangs when pnpm install at postinstall #27056

justnewbee opened this issue Jul 23, 2024 · 13 comments

Comments

@justnewbee
Copy link

Current Behavior

When initializing my repo by running pnpm install, everything was OK until it hangs at the below message:

node_modules/.pnpm/[email protected]/node_modules/nx: Running postinstall script...

It never exited, no error, no warning.

I saw nx was updated 1 hour ago, and I am very sure, it worked yesterday.

FYI, I didn't install nx, it is depended by lerna.

Expected Behavior

The install process shall exit.

GitHub Repo

No response

Steps to Reproduce

  1. I installed lerna as dev depencies:
{
  "lerna": "^8.1.7"
}

Nx Report

node_modules/.pnpm/[email protected]/node_modules/nx: Running postinstall script...


### Failure Logs

_No response_

### Package Manager Version

pnpm

### Operating System

- [X] macOS
- [ ] Linux
- [ ] Windows
- [ ] Other (Please specify)

### Additional Information

My region is in China, hope it is NOT a network issue.
@justnewbee
Copy link
Author

justnewbee commented Jul 23, 2024

// package.json
"pnpm": {
    "overrides": {
      "nx": "19.5.1"
    }
  }

I tried pnpm override and 19.5.1 is fine:

Progress: resolved 1647, reused 1601, downloaded 0, added 1605, done
node_modules/.pnpm/[email protected]/node_modules/nx: Running postinstall script, done in 704ms

Sorry I cannot upload image here.

@FrozenPandaz
Copy link
Collaborator

Hi, could you please run nx format on Nx 19.5.1 and post the output of nx report please?

And could you also please share the output of this command with Nx 19.5.2:

NX_VERBOSE_LOGGING=true NX_PERF_LOGGING=true NX_CACHE_PROJECT_GRAPH=false NX_NATIVE_LOGGING=nx node node_modules/nx/bin/post-install.js

@noe-charmet
Copy link

Encountered the issue on my side too. I manually pinned to 19.4.4 and it is now not blocking anymore.

Important thing to note is that I only had the issue when installing dependencies in arm64 (both on a ARM machine and within QEMU). No issue when downloading dependencies on amd64.

@justnewbee
Copy link
Author

Hi, could you please run nx format on Nx 19.5.1 and post the output of nx report please?

And could you also please share the output of this command with Nx 19.5.2:

NX_VERBOSE_LOGGING=true NX_PERF_LOGGING=true NX_CACHE_PROJECT_GRAPH=false NX_NATIVE_LOGGING=nx node node_modules/nx/bin/post-install.js

After I explicitly installed [email protected] in my project, this is the result:

NX_VERBOSE_LOGGING=true NX_PERF_LOGGING=true NX_CACHE_PROJECT_GRAPH=false NX_NATIVE_LOGGING=nx node node_modules/nx/bin/post-install.js
TRACE nx::native::workspace::context: workspace_root="/Users/newbee/zombie/kcuf"
TRACE nx::native::workspace::context: Initially locking files
TRACE nx::native::workspace::context: Gathering files in /Users/newbee/zombie/kcuf
TRACE nx::native::glob: converted globs globs=["**/node_modules", "**/.git", "**/.nx/cache", "**/.nx/workspace-data", "**/.yarn/cache"] result=["**/node_modules", "**/.git", "**/.nx/cache", "**/.nx/workspace-data", "**/.yarn/cache"]
TRACE nx::native::walker: walking directory="/Users/newbee/zombie/kcuf"
Nx postinstall steps took 3ms

And This is 19.5.2 output:

NX_VERBOSE_LOGGING=true NX_PERF_LOGGING=true NX_CACHE_PROJECT_GRAPH=false NX_NATIVE_LOGGING=nx node node_modules/nx/bin/post-install.js
TRACE nx::native::workspace::context: workspace_root="/Users/newbee/zombie/kcuf"
TRACE nx::native::workspace::context: Initially locking files
TRACE nx::native::workspace::context: Gathering files in /Users/newbee/zombie/kcuf
TRACE nx::native::glob: converted globs globs=["**/node_modules", "**/.git", "**/.nx/cache", "**/.nx/workspace-data", "**/.yarn/cache"] result=["**/node_modules", "**/.git", "**/.nx/cache", "**/.nx/workspace-data", "**/.yarn/cache"]
TRACE nx::native::walker: walking directory="/Users/newbee/zombie/kcuf"
Nx postinstall steps took 4ms

@justnewbee
Copy link
Author

justnewbee commented Jul 24, 2024

The problems is gone today, I removed the overrides setting, and the installation is all OK.

I see nx version is still 19.5.2, but its postinstall is NOT invoked.

@FrozenPandaz
Copy link
Collaborator

Looks like the issue has been resolved so I'm going to close the issue. Thanks all!

@imshenshen
Copy link

@FrozenPandaz I exec pnpm install on a monorepo, looks like nx use .pnpm as workspace root

node_modules/.pnpm/[email protected]_@[email protected]_@[email protected]_@[email protected]__@[email protected]_typ_2n5adhucr56bzsivvvfclmdmqe/node_modules/nx

❯ NX_VERBOSE_LOGGING=true NX_PERF_LOGGING=true NX_CACHE_PROJECT_GRAPH=false NX_NATIVE_LOGGING=nx node ./bin/post-install.js
TRACE nx::native::workspace::context: workspace_root="******/node_modules/.pnpm"
TRACE nx::native::workspace::context: Gathering files in ******/node_modules/.pnpm
TRACE nx::native::glob: converted globs globs=["**/node_modules", "**/.git", "**/.nx/cache", "**/.nx/workspace-data", "**/.yarn/cache"] result=["**/node_modules", "**/.git", "**/.nx/cache", "**/.nx/workspace-data", "**/.yarn/cache"]

@gabrielbryk
Copy link

@FrozenPandaz I exec pnpm install on a monorepo, looks like nx use .pnpm as workspace root

node_modules/.pnpm/[email protected]_@[email protected]_@[email protected]_@[email protected]__@[email protected]_typ_2n5adhucr56bzsivvvfclmdmqe/node_modules/nx

❯ NX_VERBOSE_LOGGING=true NX_PERF_LOGGING=true NX_CACHE_PROJECT_GRAPH=false NX_NATIVE_LOGGING=nx node ./bin/post-install.js
TRACE nx::native::workspace::context: workspace_root="******/node_modules/.pnpm"
TRACE nx::native::workspace::context: Gathering files in ******/node_modules/.pnpm
TRACE nx::native::glob: converted globs globs=["**/node_modules", "**/.git", "**/.nx/cache", "**/.nx/workspace-data", "**/.yarn/cache"] result=["**/node_modules", "**/.git", "**/.nx/cache", "**/.nx/workspace-data", "**/.yarn/cache"]

Getting an identical issue as @imshenshen, using pnpm v9.5.0, nx v19.5.1 (and newer versions), and node v20.10.0

@awakia
Copy link
Contributor

awakia commented Sep 18, 2024

still occurs on 19.7.4. getting back to 19.4.4 works fine.

@90dy
Copy link

90dy commented Sep 23, 2024

Not resolved, issue occur since 19.5.0

$> NX_VERBOSE_LOGGING=true NX_PERF_LOGGING=true NX_CACHE_PROJECT_GRAPH=false NX_NATIVE_LOGGING=nx node node_modules/nx/bin/post-install.js
TRACE nx::native::workspace::context: workspace_root="[...]"
TRACE nx::native::workspace::context: Initially locking files
TRACE nx::native::workspace::context: Gathering files in [...]
TRACE nx::native::glob: converted globs globs=["**/node_modules", "**/.git", "**/.nx/cache", "**/.nx/workspace-data", "**/.yarn/cache"] result=["**/node_modules", "**/.git", "**/.nx/cache", "**/.nx/workspace-data", "**/.yarn/cache"]
TRACE nx::native::walker: walking directory="[...]"
TRACE nx::native::walker: walked in 1.636625ms
TRACE nx::native::workspace::files_hashing: Found 0 files
TRACE nx::native::workspace::files_hashing: hashing workspace files in parallel
TRACE nx::native::workspace::files_hashing: hashed workspace files in 83.083µs
TRACE nx::native::workspace::context: hashed and sorted files in 1.935208ms
TRACE nx::native::workspace::files_archive: could not write files archive: No such file or directory (os error 2)
TRACE nx::native::workspace::context: files retrieved files_len=0

@keriati
Copy link

keriati commented Sep 26, 2024

Not resolved, issue occur since 19.5.0

$> NX_VERBOSE_LOGGING=true NX_PERF_LOGGING=true NX_CACHE_PROJECT_GRAPH=false NX_NATIVE_LOGGING=nx node node_modules/nx/bin/post-install.js
TRACE nx::native::workspace::context: workspace_root="[...]"
TRACE nx::native::workspace::context: Initially locking files
TRACE nx::native::workspace::context: Gathering files in [...]
TRACE nx::native::glob: converted globs globs=["**/node_modules", "**/.git", "**/.nx/cache", "**/.nx/workspace-data", "**/.yarn/cache"] result=["**/node_modules", "**/.git", "**/.nx/cache", "**/.nx/workspace-data", "**/.yarn/cache"]
TRACE nx::native::walker: walking directory="[...]"
TRACE nx::native::walker: walked in 1.636625ms
TRACE nx::native::workspace::files_hashing: Found 0 files
TRACE nx::native::workspace::files_hashing: hashing workspace files in parallel
TRACE nx::native::workspace::files_hashing: hashed workspace files in 83.083µs
TRACE nx::native::workspace::context: hashed and sorted files in 1.935208ms
TRACE nx::native::workspace::files_archive: could not write files archive: No such file or directory (os error 2)
TRACE nx::native::workspace::context: files retrieved files_len=0

I have the exact same issue on macos 14 and 15, node 20

@keriati
Copy link

keriati commented Sep 26, 2024

The exact error on my side:

❯ NX_VERBOSE_LOGGING=true NX_PERF_LOGGING=true NX_CACHE_PROJECT_GRAPH=false NX_NATIVE_LOGGING=nx node node_modules/nx/bin/post-install.js
TRACE nx::native::workspace::context: workspace_root="/Users/<username>/Projects/<project>"
TRACE nx::native::workspace::context: Initially locking files
TRACE nx::native::workspace::context: Gathering files in /Users/<username>/Projects/<project>
TRACE nx::native::glob: converted globs globs=["**/node_modules", "**/.git", "**/.nx/cache", "**/.nx/workspace-data", "**/.yarn/cache"] result=["**/node_modules", "**/.git", "**/.nx/cache", "**/.nx/workspace-data", "**/.yarn/cache"]
TRACE nx::native::walker: walking directory="/Users/<username>/Projects/<project>"
TRACE nx::native::walker: walked in 1.607167ms
TRACE nx::native::workspace::files_hashing: Found 0 files
TRACE nx::native::workspace::files_hashing: hashing workspace files in parallel
TRACE nx::native::workspace::files_hashing: hashed workspace files in 131.916µs
TRACE nx::native::workspace::context: hashed and sorted files in 1.923416ms
TRACE nx::native::workspace::files_archive: could not write files archive: No such file or directory (os error 2)
TRACE nx::native::workspace::context: files retrieved files_len=0

os: MacOS 15.0 and MacOS 14
node: v20.17.0
pnpm 9.3.0
nx: 19.8.0

Did try node 22, few pnpm versions, always the same result.

Copy link

This issue has been closed for more than 30 days. If this issue is still occuring, please open a new issue with more recent context.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Oct 27, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

8 participants