npm install gets stuck at fetchMetadata

前端 未结 12 969
星月不相逢
星月不相逢 2020-12-25 13: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

相关标签:
12条回答
  • 2020-12-25 13:56

    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.

    0 讨论(0)
  • 2020-12-25 13:58

    You can try by setting the configuration to:

     npm config set registry
    

    It works for me

    0 讨论(0)
  • 2020-12-25 14:04

    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.

    0 讨论(0)
  • 2020-12-25 14:05

    Adding to @CptUnlucky's answer.

    npm config set registry "http://registry.npmjs.org"
    

    This forces the http fetch. If this alone doesn't work, throttle the number of simultaneous connections that can be established. Default Max connections is 50.

    npm set maxsockets 3
    

    That worked for me.

    0 讨论(0)
  • 2020-12-25 14:06

    I solve this issue by opening the package-lock.json and reset all the json. Delete the current content and replace it with

    {}

    then reinstall the package.

    0 讨论(0)
  • 2020-12-25 14:08

    This is how I resolved this after spending half an hour:

    1. npm config set registry http://registry.npmjs.org/ --global
    2. npm cache clear --force
    3. setting package-lock.json to {} only
    4. npm install --verbose

    node: v12.14.1 npm: v6.13.4

    This issue occure when I tried running ng update on angular 6 app to update it to angular 9.

    0 讨论(0)
提交回复
热议问题