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
pnpm i
get stuck forever on postinstall
script
#5909
Comments
Not sure if this is related to #5823. |
I fixed it with a strange solution.
This worked for me, and I hope it can help others! |
same issue. hang up during |
Agreed, probably same as #5823 |
Please create a repo that reproduces the issue. |
same issue here, If i remove the "node-linker=hoisted" setting there seems to be no issues |
Here's a small repo that reproduces the problem Two key things in this repo:
|
Same issue. |
I don't have issues running install on the example repo: https://github.com/chungweileong94/pnpm-hang-up-bug |
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. |
I assume it stopped working in v7.19.0 due to these changes: #5814 |
This line could stuck: pnpm/exec/build-modules/src/index.ts Line 99 in 4655dd4
But I cannot think of a scenario when it would happen. I the finally block it is resolved: pnpm/exec/build-modules/src/index.ts Line 176 in 4655dd4
|
Looks like this happens a lot but I cannot reproduce it. Please try to debug it yourself and see where and why the issue happens. Also might be useful to find out which exact version of pnpm has introduced the issues (or even which commit). |
I specifically remember I was facing issue #5823 before, then it was fixed by #5902, however, it started to have this issue. |
Try to run with |
|
It seems to happen on secondary or external volumes and not on main? Can you confirm? I'm also facing the same issue. Also mac as well. Maybe it's related to this: oven-sh/bun#362 (comment) |
+1 |
I have tried to reproduce it by running install on a flash drive. It didn't stuck for me. (on macOS as well) |
@pnpm/collaborators if anyone can reproduce this, please help me find the issue. |
Maybe our setup is a bit different, on Mac there is a thing called Volumes, not a physical partition, it's more logical. It will give the same space as the original. Perhaps that could be it. The reason I have done it this way is to enable case sensitive for certain directories, because Mac decides to have file system case insensitive by default, which is bad for git. |
So I tested it on my work machine with only one drive (main drive), and everything seems to work fine. |
Then maybe it gets stuck at this point: pnpm/exec/build-modules/src/index.ts Line 173 in 94ef329
|
@bchilcott does it say "done" when installing postinstall or just nothing, unlike others |
But what is stranger though I was facing this issues in pnpm 7.17, also created an issue (#5706) but no one responded |
You're right, mine doesn't say done. I guess mine must be a separate issue related to the one you opened, rather than this one. |
Then move onto mine |
This memory issue: #5909 (comment) is probably fixed in v7.26.1 |
Hello, I just tested with ➜ snaplet-labs git:(main) ✗ pnpm i
Scope: all 11 workspace projects
Lockfile is up to date, resolution step is skipped
Packages: +860
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
node_modules/@prisma/engines: Running postinstall script, done in 147ms
node_modules/prisma/node_modules/@prisma/engines: Running postinstall script, done in 147ms
node_modules/turbo: Running postinstall script, done in 140ms
<--- Last few GCs --->
[3192:0x160040000] 1088169 ms: Mark-sweep 4049.7 (4140.7) -> 4039.0 (4143.2) MB, 1907.2 / 0.0 ms (average mu = 0.578, current mu = 0.253) task; scavenge might not succeed
[3192:0x160040000] 1091659 ms: Mark-sweep 4052.1 (4143.2) -> 4041.4 (4145.5) MB, 2843.5 / 0.0 ms (average mu = 0.408, current mu = 0.185) task; scavenge might not succeed
<--- JS stacktrace --->
FATAL ERROR: Reached heap limit Allocation failed - JavaScript heap out of memory
1: 0x102ca0794 node::Abort() [/Users/jgoux/Library/pnpm/nodejs/18.13.0/bin/node]
2: 0x102ca0984 node::ModifyCodeGenerationFromStrings(v8::Local<v8::Context>, v8::Local<v8::Value>, bool) [/Users/jgoux/Library/pnpm/nodejs/18.13.0/bin/node]
3: 0x102df3790 v8::internal::V8::FatalProcessOutOfMemory(v8::internal::Isolate*, char const*, bool) [/Users/jgoux/Library/pnpm/nodejs/18.13.0/bin/node]
4: 0x102f9e704 v8::internal::EmbedderStackStateScope::EmbedderStackStateScope(v8::internal::Heap*, v8::internal::EmbedderStackStateScope::Origin, cppgc::EmbedderStackState) [/Users/jgoux/Library/pnpm/nodejs/18.13.0/bin/node]
5: 0x102f9d1e8 v8::internal::Heap::CollectGarbage(v8::internal::AllocationSpace, v8::internal::GarbageCollectionReason, v8::GCCallbackFlags) [/Users/jgoux/Library/pnpm/nodejs/18.13.0/bin/node]
6: 0x10301e3bc v8::internal::ScavengeJob::Task::RunInternal() [/Users/jgoux/Library/pnpm/nodejs/18.13.0/bin/node]
7: 0x102cfdc60 node::PerIsolatePlatformData::RunForegroundTask(std::__1::unique_ptr<v8::Task, std::__1::default_delete<v8::Task> >) [/Users/jgoux/Library/pnpm/nodejs/18.13.0/bin/node]
8: 0x102cfc8cc node::PerIsolatePlatformData::FlushForegroundTasksInternal() [/Users/jgoux/Library/pnpm/nodejs/18.13.0/bin/node]
9: 0x1035bcbc8 uv__async_io [/Users/jgoux/Library/pnpm/nodejs/18.13.0/bin/node]
10: 0x1035cf36c uv__io_poll [/Users/jgoux/Library/pnpm/nodejs/18.13.0/bin/node]
11: 0x1035bd098 uv_run [/Users/jgoux/Library/pnpm/nodejs/18.13.0/bin/node]
12: 0x102bf1704 node::SpinEventLoop(node::Environment*) [/Users/jgoux/Library/pnpm/nodejs/18.13.0/bin/node]
13: 0x102cdcd14 node::NodeMainInstance::Run() [/Users/jgoux/Library/pnpm/nodejs/18.13.0/bin/node]
14: 0x102c6e614 node::LoadSnapshotDataAndRun(node::SnapshotData const**, node::InitializationResult const*) [/Users/jgoux/Library/pnpm/nodejs/18.13.0/bin/node]
15: 0x102c6e898 node::Start(int, char**) [/Users/jgoux/Library/pnpm/nodejs/18.13.0/bin/node]
16: 0x18fc1fe50 start [/usr/lib/dyld]
[1] 3192 abort pnpm i |
This comment was marked as off-topic.
This comment was marked as off-topic.
@zkochan Can confirm that this branch fixes it while I still got the error using |
@mgcrea thanks, I have released that fix in v7.26.3 |
Had the same thing with the For me, it didn't work in 7.26.2. (And had to downgrade to 7.18.2 as well) |
Great, but I am not sure it fixes the initial issue. @chungweileong94 do you still have the issue in v7.26.3? |
I tested v7.26.3 and it's working 🎉 |
Yeah, the latest version 7.26.3 seems to fix the issue on my side as well. Appreciate the fix and the other people involved👍 |
@zkochan This issue seems to be back in v7.27.0, reverting back to v7.26.3 fixes it. - pnpm 7.27.0
+ pnpm 7.26.3 (7.27.0 is available) Here is the output I'm seeing when it fails trying to install a dependency, this is using turborepo and Relinking /home/edgar/workspace/restoration-md/monorepo/node_modules/log-symbols/node_modules/chalk from the store
../../node_modules/es5-ext: Running postinstall script, done in 49ms
../../node_modules/sharp: Running install script, done in 187ms
../../node_modules/supabase: Running postinstall script, done in 2s
../../node_modules/turbo: Running postinstall script, done in 41ms
../.. | Progress: resolved 574, reused 583, downloaded 0, added 36, done
<--- Last few GCs --->
[43850:0x4b9e900] 88618 ms: Mark-sweep 4046.9 (4138.5) -> 4036.4 (4141.0) MB, 2267.4 / 0.0 ms (average mu = 0.094, current mu = 0.022) task scavenge might not succeed
[43850:0x4b9e900] 90941 ms: Mark-sweep 4049.2 (4141.0) -> 4038.8 (4143.5) MB, 2279.7 / 0.0 ms (average mu = 0.058, current mu = 0.018) task scavenge might not succeed
<--- JS stacktrace --->
FATAL ERROR: Ineffective mark-compacts near heap limit Allocation failed - JavaScript heap out of memory
1: 0xb09980 node::Abort() [node]
2: 0xa1c235 node::FatalError(char const*, char const*) [node]
3: 0xcf784e v8::Utils::ReportOOMFailure(v8::internal::Isolate*, char const*, bool) [node]
4: 0xcf7bc7 v8::internal::V8::FatalProcessOutOfMemory(v8::internal::Isolate*, char const*, bool) [node]
5: 0xeaf465 [node]
6: 0xeaff46 [node]
7: 0xebe46e [node]
8: 0xebeeb0 v8::internal::Heap::CollectGarbage(v8::internal::AllocationSpace, v8::internal::GarbageCollectionReason, v8::GCCallbackFlags) [node]
9: 0xf222f4 v8::internal::ScavengeJob::Task::RunInternal() [node]
10: 0xdb59db non-virtual thunk to v8::internal::CancelableTask::Run() [node]
11: 0xb77524 node::PerIsolatePlatformData::RunForegroundTask(std::unique_ptr<v8::Task, std::default_delete<v8::Task> >) [node]
12: 0xb79389 node::PerIsolatePlatformData::FlushForegroundTasksInternal() [node]
13: 0x15633c6 [node]
14: 0x1575af4 [node]
15: 0x1563d18 uv_run [node]
16: 0xa43dd5 node::SpinEventLoop(node::Environment*) [node]
17: 0xb4bab6 node::NodeMainInstance::Run(node::EnvSerializeInfo const*) [node]
18: 0xacd3f2 node::Start(int, char**) [node]
19: 0x7f2c40623510 [/lib/x86_64-linux-gnu/libc.so.6]
20: 0x7f2c406235c9 __libc_start_main [/lib/x86_64-linux-gnu/libc.so.6]
21: 0xa4076c [node]
fish: Job 1, 'pnpm add @clerk/clerk-react' terminated by signal SIGABRT (Abort) |
I am not sure why. I did not touch any of the related code. |
Lol that's weird... I can confirm this happens on Linux and my coworker Mac, same for him reverting to v7.26.3 fixed it. |
It's probably something else, it doesn't seem to happen in my sample repo, tested with v7.27.0 |
Only happens in that turborepo, removing all My guess is it has has something to do with the .npmrc config, which has I don't have more time to debug it till the weekend, I'll see if there's any more info on the root cause I can find and share it here. |
Facing the same issue pnpm@8.1.1 |
In case it helps: I was getting this issue consistently on newly created sveltekit apps, using I could reliably see I'm on pnpm 8.5.0. Upgrading from nodejs LTS 18.12.1 to nodejs current (20.1.0) resolved the issue. |
no sure if my one is the same. I'm using pnpm in a monorepo with The total time to even add a small package is 42s while for yarn it only takes 13s with the same repo. I've tried 7.1.1, 7.26.3, 7.33.1 and 8.6.3 |
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: |
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 packageAdditional information:
node -v
prints: v16.19.0The text was updated successfully, but these errors were encountered: