NPM install hangs on loadRequestedDeps
Solution 1
So, after trying to clear the npm cache, update my npm and node version, reinstalling npm and node, etc... I found that changing my Environment Variable TEMP
to = C:\tmp
worked. I'm not sure why. Any info would be nice.
I found the answer from this thread: npm install hangs on windows with multiple temp directories set
NOTE: I could use the method he uses (using the set
command on my directory, but I had to do this with every new project. Changing the variable via System
, Advanced System Settings
, Environment Variables
changed it globablly, so now I'm all good to go.
Solution 2
I had this exact same issue, and it drove me crazy for about a day before I found these solutions.
After creating a new "tmp" folder in my C drive, and then changing the TEMP variable in my SYSTEM Environment variables to C:\tmp. My "npm install" was still not working. (This action was based on Zach Nagatani's answer.)
I also had two TEMP variables defined in my USER Environment variables, and I had to delete one of the variables for my "npm install" to start working.
The above action was based on this post: https://github.com/npm/npm/issues/7590
I was so glad when I found it. Many thanks to you all.
Solution 3
Create new folder tmp in C: drive and go to the command prompt and type:
npm config set tmp C:/tmp
Solution 4
npm cache verify
did the trick for me!
EDIT
npm
was stuck on loadAllDepsIntoIdealTree
.
I couldn't figure out the issue, so it got me here. I saw @franckstifler's answer about npm cache clear
and tried that, but the command was deprecated.
The shell itself instead suggested using npm cache verify
. I did that and it worked! The garbage data in cache got swiped away and I rerun npm i --save-dev
on my working folder and it worked.
Solution 5
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 )
Zach Nagatani
Updated on June 04, 2022Comments
-
Zach Nagatani 6 months
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 [email protected] npm info using [email protected] 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 [email protected] npm info using [email protected] 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',
-
Zach Nagatani almost 6 yearsI did try clearing my cache before and it didn't work. I will post with what worked, though. Thanks!
-
quoo almost 6 yearsSuggesting another tool is not a helpful response as that's often not an option.
-
Narendra over 5 yearscreate a temp folder(tmp) in c directory add an entry in environment variables like key = TEMP and value = c://tmp
-
Thiago Villa over 4 years
npm
was stuck onloadAllDepsIntoIdealTree
. I couldn't figure out the issue, so it got me here. I saw @franckstifler's answer below aboutnpm cache clear
and tried that, but such command was deprecated. The shell instead suggested usingnpm cache verify
. I did that and it worked. The garbage data in the cache got swiped away and I rerunnpm i --save-dev
on my working folder and it simply worked. -
Blip over 4 yearsedit your post and elaborate your answer with whatever you have written in the comment. This will help other users who will come to this question for a solution.