NPM install hangs on loadRequestedDeps

2020-04-08 13:07发布

When I download any package using NPM, it hangs on the last command "loadRequestedDeps." I've added my whole -verbose output to the end of this question for reference. It will just sit there until I cancel the command, and nothing will be installed and my package.json will not be updated.

What could the issue be? I've looked around but haven't found out how to fix my particular problem.

Here's some info:

  • OS is Windows 10
  • Node version is 6.9.1
  • NPM version is 3.10.8
  • My CPU maxes out at 100% whenever I run NPM install. Could that be the issue itself? I used to be able to use NPM install on this computer, however.

Thanks for anyone who can help. The verbose output is below.

npm info it worked if it ends with ok
npm info using npm@3.10.8
npm info using node@v6.9.1
npm info ok
npm info it worked if it ends with ok
npm verb cli [ 'C:\\Program Files\\nodejs\\node.exe',
npm verb cli   'C:\\Program Files\\nodejs\\node_modules\\npm\\bin\\npm-cli.js',
npm verb cli   'install',
npm verb cli   'moment',
npm verb cli   '--save',
npm verb cli   '-verbose' ]
npm info using npm@3.10.8
npm info using node@v6.9.1
npm verb request uri https://registry.npmjs.org/moment
npm verb request no auth needed
npm info attempt registry request try #1 at 11:19:11 AM
npm verb request id 6aa9ece5a04fcd33
npm verb etag W/"583b0871-194b0"
npm verb lastModified Sun, 27 Nov 2016 16:23:13 GMT
npm http request GET https://registry.npmjs.org/moment
npm http 304 https://registry.npmjs.org/moment
npm verb headers { date: 'Tue, 29 Nov 2016 19:19:02 GMT',
npm verb headers   via: '1.1 varnish',
npm verb headers   'cache-control': 'max-age=300',
npm verb headers   etag: 'W/"583b0871-194b0"',
npm verb headers   age: '11',
npm verb headers   connection: 'keep-alive',
npm verb headers   'x-served-by': 'cache-sjc3136-SJC',
npm verb headers   'x-cache': 'HIT',
npm verb headers   'x-cache-hits': '1',
npm verb headers   'x-timer': 'S1480447142.653125,VS0,VE0',
npm verb headers   vary: 'Accept-Encoding' }
npm verb etag https://registry.npmjs.org/moment from cache
npm verb get saving moment to C:\Users\Zach\AppData\Roaming\npm-cache\registry.npmjs.org\moment\.cache.json
npm verb correctMkdir C:\Users\Zach\AppData\Roaming\npm-cache correctMkdir not in flight; initializing
npm verb cache add spec moment
npm verb addNamed "latest" is being treated as a dist-tag for moment
npm info addNameTag [ 'moment', 'latest' ]
npm verb addNameTag registry:https://registry.npmjs.org/moment not in flight; fetching
npm verb get https://registry.npmjs.org/moment not expired, no request
npm verb addNamed "2.17.0" is a plain semver version for moment
npm verb addRemoteTarball https://registry.npmjs.org/moment/-/moment-2.17.0.tgz not in flight; adding
npm verb addRemoteTarball [ 'https://registry.npmjs.org/moment/-/moment-2.17.0.tgz',
npm verb addRemoteTarball   'a4c292e02aac5ddefb29a6eed24f51938dd3b74f' ]
[    ..............] \ loadRequestedDeps: verb addRemoteTarball [ 'https://registry.npmjs.org/moment/-/moment-2.17.0.tgz',

8条回答
▲ chillily
2楼-- · 2020-04-08 13:40

this is very general error .. you have to debug with

npm install -verbose

it maybe 1) locked package.json 2) you are in private network and can't access outside world for some reason 3) cache is not good ( you may try with npm clear cache ) or ( cache verify ) or even changing its path (npm config set tmp )

查看更多
Deceive 欺骗
3楼-- · 2020-04-08 13:49

Create new folder tmp in C: drive and go to the command prompt and type:

npm config set tmp C:/tmp

查看更多
登录 后发表回答