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

pnpm install stuck for ~2 minutes #4739

Closed
vrde opened this issue May 15, 2022 · 20 comments
Closed

pnpm install stuck for ~2 minutes #4739

vrde opened this issue May 15, 2022 · 20 comments
Milestone

Comments

@vrde
Copy link

vrde commented May 15, 2022

When I run pnpm install it gets stuck. I didn't understand if there is a pattern or not, sometimes it gets stuck, sometimes it doesn't.

pnpm version:

7.1.0

Code to reproduce the issue:

When I run pnpm i it starts do its job, then it gets stuck for ~2 min, then I get a  ERR_PNPM_PEER_DEP_ISSUES  Unmet peer dependencies.

The full message is:

 ERR_PNPM_PEER_DEP_ISSUES  Unmet peer dependencies

.
├─┬ @typechain/hardhat
│ └── ✕ missing peer lodash@^4.17.15
├─┬ @typechain/truffle-v5
│ └── ✕ missing peer truffle@^5.0.0
└─┬ @typechain/ethers-v5
  ├── ✕ missing peer @ethersproject/bytes@^5.0.0
  └── ✕ missing peer @ethersproject/abi@^5.0.0
Peer dependencies that should be installed:
  @ethersproject/abi@^5.0.0    lodash@^4.17.15              
  @ethersproject/bytes@^5.0.0  truffle@^5.0.0

This is node_modules/.pnpm-debug.log:

"err": {
      "name": "pnpm",
      "message": "Unmet peer dependencies",
      "code": "ERR_PNPM_PEER_DEP_ISSUES",
      "stack": "pnpm: Unmet peer dependencies\n    at default_1 (/home/vrde/.nvm/versions/node/v16.15.0/lib/node_modules/pnpm/dist/pnpm.cjs:119805:15)\n    at _installInContext (/home/vrde/.nvm/versions/node/v16.15.0/lib/node_modules/pnpm/dist/pnpm.cjs:120522:48)\n    at async installInContext (/home/vrde/.nvm/versions/node/v16.15.0/lib/node_modules/pnpm/dist/pnpm.cjs:120565:16)\n    at async _install (/home/vrde/.nvm/versions/node/v16.15.0/lib/node_modules/pnpm/dist/pnpm.cjs:120167:25)\n    at async mutateModules (/home/vrde/.nvm/versions/node/v16.15.0/lib/node_modules/pnpm/dist/pnpm.cjs:119953:23)\n    at async install (/home/vrde/.nvm/versions/node/v16.15.0/lib/node_modules/pnpm/dist/pnpm.cjs:119911:24)\n    at async handler (/home/vrde/.nvm/versions/node/v16.15.0/lib/node_modules/pnpm/dist/pnpm.cjs:121558:31)\n    at async /home/vrde/.nvm/versions/node/v16.15.0/lib/node_modules/pnpm/dist/pnpm.cjs:176441:21\n    at async run (/home/vrde/.nvm/versions/node/v16.15.0/lib/node_modules/pnpm/dist/pnpm.cjs:176415:34)\n    at async runPnpm (/home/vrde/.nvm/versions/node/v16.15.0/lib/node_modules/pnpm/dist/pnpm.cjs:176633:5)"
    }

Expected behavior:

I expect PNPM to not get stuck when installing packages.

Actual behavior:

PNPM stays ~2 min stuck when installing packages.

Additional information:

  • node -v prints: v16.15.0
  • Windows, macOS, or Linux?: Linux
@vrde vrde added the type: bug label May 15, 2022
@vrde vrde changed the title pnpm install stuck for ~1 minute pnpm install stuck for ~2 minutes May 15, 2022
@grassick
Copy link

There is a bizarre issue with installing github dependencies right now: npm/cli#4896

This seems to be affecting both pnpm and npm (version 6). Did the delays start on May 13 and are they for repos with github dependencies?

@vrde
Copy link
Author

vrde commented May 15, 2022

The first time I experienced this slow down was few days ago, might be May 13th as well. I don't have any github depencency in my package.json, how can I check if that's true for the packages I import?

@RealAlphabet
Copy link

RealAlphabet commented May 15, 2022

Same here.

There is a bizarre issue with installing github dependencies right now: npm/cli#4896

This seems to be affecting both pnpm and npm (version 6). Did the delays start on May 13 and are they for repos with github dependencies?

Does this only affect version 6?

@grassick
Copy link

@vrde Try: pnpm i --reporter ndjson and it will list each connection as it happens. When it stalls for a long time, hit enter a bunch of times to add some space. Then once it's done, scroll back up and see which connection was slow (the first line printed after the delay)

@vrde
Copy link
Author

vrde commented May 15, 2022

{"time":1652627302946,"hostname":"circe","pid":370642,"level":"debug","name":"pnpm:_dependency_resolved","resolution":"registry.npmjs.org/randombytes/2.1.0","wanted":{"dependentId":"/@walletconnect/randombytes/1.0.2","name":"randombytes","rawSpec":"^2.1.0"}}
{"time":1652627302951,"hostname":"circe","pid":370642,"level":"debug","name":"pnpm:progress","packageId":"registry.npmjs.org/@walletconnect/randombytes/1.0.2","requester":"/home/vrde/repos/vrde/amuleto/web","status":"found_in_store"}


# 😴 taking a 2 min and 8 second break


{"time":1652627431479,"hostname":"circe","pid":370642,"level":"debug","name":"pnpm:_dependency_resolved","resolution":"github.com/ethereumjs/ethereumjs-abi/ee3994657fa7a427238e6ba92a84d0b529bbcde0","wanted":{"dependentId":"/eth-sig-util/1.4.2","name":"ethereumjs-abi","rawSpec":"git+https://github.com/ethereumjs/ethereumjs-abi.git"}}
{"time":1652627431484,"hostname":"circe","pid":370642,"level":"debug","name":"pnpm:progress","packageId":"github.com/ethereumjs/ethereumjs-abi/ee3994657fa7a427238e6ba92a84d0b529bbcde0","requester":"/home/vrde/repos/vrde/amuleto/web","status":"found_in_store"}
{"time":1652627431485,"hostname":"circe","pid":370642,"level":"debug","name":"pnpm:progress","packageId":"github.com/ethereumjs/ethereumjs-abi/ee3994657fa7a427238e6ba92a84d0b529bbcde0","requester":"/home/vrde/repos/vrde/amuleto/web","status":"resolved"}
{"time":1652627431671,"hostname":"circe","pid":370642,"level":"debug","name":"pnpm:_dependency_resolved","resolution":"registry.npmjs.org/bn.js/4.12.0","wanted":{"dependentId":"github.com/ethereumjs/ethereumjs-abi/ee3994657fa7a427238e6ba92a84d0b529bbcde0","name":"bn.js","rawSpec":"^4.11.8"}}
{"time":1652627431725,"hostname":"circe","pid":370642,"level":"debug","name":"pnpm:_dependency_resolved","resolution":"registry.npmjs.org/ethereumjs-util/6.2.1","wanted":{"dependentId":"github.com/ethereumjs/ethereumjs-abi/ee3994657fa7a427238e6ba92a84d0b529bbcde0","name":"ethereumjs-util","rawSpec":"^6.0.0"}}
{"time":1652627431729,"hostname":"circe","pid":370642,"level":"debug","name":"pnpm:package-manifest","prefix":"/home/vrde/repos/vrde/amuleto/web","updated":{"name":"amulet-dapp","private":true,"version":"0.0.0","type":"module","scripts":{"dev":"vite","build":"vite build","preview":"vite preview","check":"svelte-check --tsconfig ./tsconfig.json"},"devDependencies":{"@esbuild-plugins/node-globals-polyfill":"^0.1.1","@rollup/plugin-inject":"^4.0.4","@rollup/plugin-replace":"^4.0.0","@sveltejs/vite-plugin-svelte":"^1.0.0-next.44","@tsconfig/svelte":"^3.0.0","@walletconnect/web3-provider":"^1.7.8","ethers":"^5.6.6","rollup-plugin-copy":"^3.4.0","rollup-plugin-polyfill-node":"^0.9.0","svelte":"^3.48.0","svelte-check":"^2.7.1","svelte-preprocess":"^4.10.6","tinro":"^0.6.12","tslib":"^2.4.0","typescript":"^4.6.4","util":"^0.12.4","vite":"^2.9.9","vite-plugin-html":"^3.2.0","web3modal":"^1.9.7"}}}
{"time":1652627431859,"hostname":"circe","pid":370642,"level":"debug","name":"pnpm:stage","prefix":"/home/vrde/repos/vrde/amuleto/web","stage":"resolution_done"}
{"time":1652627431864,"hostname":"circe","pid":370642,"level":"debug","name":"pnpm:stats","prefix":"/home/vrde/repos/vrde/amuleto/web","removed":0}
{"time":1652627431866,"hostname":"circe","pid":370642,"level":"debug","name":"pnpm:stage","prefix":"/home/vrde/repos/vrde/amuleto/web","stage":"importing_started"}
{"time":1652627431876,"hostname":"circe","pid":370642,"level":"debug","name":"pnpm:stats","added":561,"prefix":"/home/vrde/repos/vrde/amuleto/web"}

@grassick
Copy link

@vrde So, yes, same bug. Is for github.com/ethereumjs/ethereumjs-abi

@Luke-zhang-04
Copy link

Same here.

There is a bizarre issue with installing github dependencies right now: npm/cli#4896
This seems to be affecting both pnpm and npm (version 6). Did the delays start on May 13 and are they for repos with github dependencies?

Does this only affect version 6?

Interesting observation: this doesn't seem to affect Yarn at all, and replacing github: with git+https://github.com/ seems to fix it on NPM's side (npm/cli#4896 (comment)).

I'm also getting this issue on PNPM 7.

@grassick
Copy link

It is attempting to use git protocol, even when explicitly set to ssh. e.g. in package.json:

"jsonql": "git+ssh://git@github.com:mWater/jsonql.git",

But running pnpm i causes network traffic to git port:

$ netstat | grep git
tcp        0      1 clayton-desktop:56362   lb-140-82-112-4-iad:git SYN_SENT   
tcp        0      1 clayton-desktop:56388   lb-140-82-112-4-iad:git SYN_SENT   
tcp        0      1 clayton-desktop:56360   lb-140-82-112-4-iad:git SYN_SENT   
tcp        0      1 clayton-desktop:56358   lb-140-82-112-4-iad:git SYN_SENT   

And git protocol is no longer supported by GitHub:

https://github.blog/2021-09-01-improving-git-protocol-security-github/

This is with latest pnpm (7.1.0)

@wobsoriano
Copy link

wobsoriano commented May 15, 2022

Encountering this as well with these packages:

packages/app                           |  WARN  deprecated safe-event-emitter@1.0.1
docs                                           |  WARN  deprecated node-pre-gyp@0.13.0
packages/app                           |  WARN  deprecated safe-event-emitter@1.0.1
packages/app                           |  WARN  deprecated eth-sig-util@1.4.2
packages/app                           |  WARN  deprecated @walletconnect/mobile-registry@1.4.0
packages/app                           |  WARN  deprecated safe-event-emitter@1.0.1

@remorses
Copy link

For me this happens when installing packages from github

@eldadpuzach
Copy link

eldadpuzach commented May 17, 2022

node: v11.13.0
npm: v6.7.0

Our npm ci build step duration increased from ~4min to ~45min.

Solved by replacing github protocol with https
at package-lock.json & package.json
e.g.:

-    "angular-daterangepicker": "github:fragaria/angular-daterangepicker",
+    "angular-daterangepicker": "https://github.com/fragaria/angular-daterangepicker",

@remorses
Copy link

Found a solution:

Run git config --global url."ssh://git@".insteadOf git://
This appears to configure it to use ssh instead of the git protocol which no longer works.

Found here npm/cli#4896 (comment)

@zkochan
Copy link
Member

zkochan commented May 17, 2022

I guess related fix: #4734

@dkozickis
Copy link

@zkochan would you mind releasing a patch version please, when time permits?

@zkochan
Copy link
Member

zkochan commented May 17, 2022

Try v7.1.1

@privatenumber
Copy link
Sponsor

Back to being blazing fast again! Thanks @zkochan 🙏

$ time pnpm i -D 'esbuild-kit/tsx#built/repl'
Packages: +9
+++++++++
Packages are hard linked from the content-addressable store to the virtual store.
  Content-addressable store is at: ~/Library/pnpm/store/v3
  Virtual store is at:             node_modules/.pnpm
Progress: resolved 28, reused 9, downloaded 0, added 9, done

devDependencies:
+ tsx 0.0.0-semantic-release
pnpm i -D 'esbuild-kit/tsx#built/repl'  1.30s user 0.27s system 68% cpu 2.304 total

@zkochan zkochan closed this as completed May 17, 2022
@zkochan zkochan added this to the v7.1 milestone May 17, 2022
@vrde
Copy link
Author

vrde commented May 18, 2022

Works like a charm, thanks @zkochan!

@laurix-dev
Copy link

Version 7.11.0 also fixed this issue for me 😄

@kickbk
Copy link

kickbk commented Jan 16, 2023

To avoid starting a new thread, my pnpm i --reporter ndjson hangs forever on

{"time":1673900426574,"hostname":"_.charter.com","pid":17212,"level":"debug","name":"pnpm:progress","method":"hardlink","requester":"/...","status":"imported","to":"/.../node_modules/rxjs/node_modules/tslib"}

Using pnpm v7.25.0

It just all of a sudden started hanging.

EDIT
Adding a dev dependency "tslib": "2.4.1" and installing makes it not hang anymore. Removing the dependency after a successful installation still passes. Not sure what's going on here.

@zkochan
Copy link
Member

zkochan commented Jan 17, 2023

It is this issue: #5909

@pnpm pnpm locked as resolved and limited conversation to collaborators Jan 17, 2023
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