pnpm: `pnpm i` get stuck forever on `postinstall` script
pnpm version: 7.24.2
Code to reproduce the issue:
pnpm install
Expected behavior:
All packages successfully installed
Actual behavior:
Get stuck in one of the postinstall scripts from a package

Additional information:
node -vprints: v16.19.0- Windows, macOS, or Linux?: macOS
About this issue
- Original URL
- State: closed
- Created 4 years ago
- Reactions: 15
- Comments: 66 (25 by maintainers)
Commits related to this issue
- fix: out of memory exception with node-linker=hoisted ref #5909 — committed to pnpm/pnpm by zkochan 4 years ago
- fix: out of memory exception with node-linker=hoisted (#5988) ref #5909 — committed to pnpm/pnpm by zkochan 4 years ago
- fix(deps): update symlink-dir ref #5909 — committed to pnpm/pnpm by zkochan 4 years ago
Facing the same issue pnpm@8.1.1
I encountered the same frozen issue when upgrading from pnpm@8.15.7 to pnpm@9.0.0 and the latest (9.0.6).
After the upgrade, I deleted both the node_modules and pnpm-lock.yaml before performing the new pnpm install and getting a consistent freeze.
pnpm install works fine again after I reverted back to pnpm@8.15.7.
I’m using Nx Workspace with shamefully-hoist=true as well.
pnpm i --reporter ndjson shows frozen always after this entry: {“time”:1714171496637,“hostname”:“”,“pid”:,“level”:“debug”,“name”:“pnpm:_dependency_resolved”,“resolution”:“@mikro-orm/core@5.9.7”,“wanted”:{“dependentId”:“.”,“name”:“@mikro-orm/core”,“rawSpec”:“5.9.7”}}
@mgcrea thanks, I have released that fix in v7.26.3
same issue here, If i remove the “node-linker=hoisted” setting there seems to be no issues
I tested v7.26.3 and it’s working 🎉
Hello, I just tested with
v7.26.1and the issue is still there:It looks like it works if
prefer-symlinked-executablesis set tofalse, or this line is commented out:https://github.com/pnpm/pnpm/blob/5bede17edb5359daf6078bf69d488069b1b2ceba/pkg-manager/link-bins/src/index.ts#L214
I also experience this issue now with prisma. Keep in mind that it’s not happening on first install. This starts happening with the second install.
Here’s a small repo that reproduces the problem https://github.com/chungweileong94/pnpm-hang-up-bug
Two key things in this repo:
node-linker=hoistedpostinstall@zkochan This issue seems to be back in v7.27.0, reverting back to v7.26.3 fixes it.
Here is the output I’m seeing when it fails trying to install a dependency, this is using turborepo and
node-linker=hoisted->@zkochan Can confirm that this branch fixes it while I still got the error using
v7.26.1🎉We have debugged it a bit with @kickbk
These are some of the findings so far:
package-import-method=copyis set in.npmrc(or you runpnpm install --package-import-method=copyhttps://github.com/pnpm/pnpm/blob/98d6603f317a9ab28a2181aabbf63dd0f98d3804/pkg-manager/headless/src/linkHoistedModules.ts#L136-L140
It got stuck when linking bins to
node_modules/react-native/node_modules/.binFurthermore, downgrading to
7.18.2seems to fix the issue. Using7.19.0results inWARN An error occurred while uploadingfor various packages (the same as https://github.com/pnpm/pnpm/issues/5823) and using7.24.0gets rid of the warning but then results in the hang that this issue is related to.I specifically remember I was facing issue #5823 before, then it was fixed by #5902, however, it started to have this issue.
Not sure if this is related to https://github.com/pnpm/pnpm/issues/5823. If you remove
node_modules, then runpnpm i, it will run perfectly fine. But it will get stuck in subsequencepnpm i