npm install gets stuck at fetchMetadata

2020-02-26 05:40发布

I'm currently unable to run npm install in any project since today. I'm running node v8.2.1 & npm 5.3.0 (installed via nvm).

When typing npm install it gets stuck on fetchMetadata everytime: ⸨ ░░░░░░░░░░░░░░░░⸩ ⠧ fetchMetadata: sill pacote range manifest for longest@^1.0.1 fetched in 197ms

I've tried switching back to npm 5.0.3 which worked flawless, but still get stuck.

Details to my computer: MacBook Pro running macOS 10.12.6

标签: node.js npm
10条回答
欢心
2楼-- · 2020-02-26 06:13

I got stuck when doing npm install with couchdb-fauxton, I normally sit behind a corporation firewall and uses proxy everywhere, but switched to a direct connection, because using npm config proxy didn't work out for me. But the npm install uses git, which I still set to use proxy, that's how my install got stuck. After disable the proxy in git, it worked.

查看更多
The star\"
3楼-- · 2020-02-26 06:17

I have experienced this and fixed it with rm -rf ~/.npm or npm cache clean.

If that doesn't work, perhaps install with Homebrew instead of nvm, to eliminate some possibilities.

查看更多
Explosion°爆炸
4楼-- · 2020-02-26 06:19

Probably not the best solution, but my workaround was to push up my active branches to origin, re-clone my repo into a different folder, then npm install in the new folder.

查看更多
forever°为你锁心
5楼-- · 2020-02-26 06:23

As a first thing, run npm install --verbose to see more!

What happened in my case:

In your package.json search for packages you directly get from Github. In my case such a package did not exist anymore. Such lines look like

"NAME_OF_PACKAGE": "git+ssh://git@github.com/SOME_USER/NAME_OF_PACKAGE.git",

Remove the package, fix the name/location or change to the npm version of the package.


Further note: I got several other similar errors, all the same but the package name was different from longest@^1.0.1. I also had p-try@something or array-ify@something


For me all that didn't work: rm -rf ~/.npm, npm cache clean or rm package-lock.json all didn't work!

查看更多
登录 后发表回答