'npm install hangs on loadIdealTree:loadAllDepsIntoIdealTree: sill install loadIdealTree
I have a Node.js application. When I try to run npm install
it hangs with this:
loadIdealTree:loadAllDepsIntoIdealTree: sill install loadIdealTree
npm install --verbose
gives me a little extra info:
npm info it worked if it ends with ok
npm verb cli [ '/usr/local/bin/node',
npm verb cli '/usr/local/bin/npm',
npm verb cli 'install',
npm verb cli '--verbose',
npm verb cli 'aws-sdk-js' ]
npm info using [email protected]
npm info using [email protected]
npm verb npm-session ea38310110279de7
npm http fetch GET 404 https://registry.npmjs.org/aws-sdk-js 2211ms
npm verb stack Error: 404 Not Found: aws-sdk-js@latest
npm verb stack at fetch.then.res (/usr/local/lib/node_modules/npm/node_modules/pacote/lib/fetchers/registry/fetch.js:42:19)
npm verb stack at tryCatcher (/usr/local/lib/node_modules/npm/node_modules/bluebird/js/release/util.js:16:23)
npm verb stack at Promise._settlePromiseFromHandler (/usr/local/lib/node_modules/npm/node_modules/bluebird/js/release/promise.js:512:31)
npm verb stack at Promise._settlePromise (/usr/local/lib/node_modules/npm/node_modules/bluebird/js/release/promise.js:569:18)
npm verb stack at Promise._settlePromise0 (/usr/local/lib/node_modules/npm/node_modules/bluebird/js/release/promise.js:614:10)
npm verb stack at Promise._settlePromises (/usr/local/lib/node_modules/npm/node_modules/bluebird/js/release/promise.js:693:18)
npm verb stack at Async._drainQueue (/usr/local/lib/node_modules/npm/node_modules/bluebird/js/release/async.js:133:16)
npm verb stack at Async._drainQueues (/usr/local/lib/node_modules/npm/node_modules/bluebird/js/release/async.js:143:10)
npm verb stack at Immediate.Async.drainQueues (/usr/local/lib/node_modules/npm/node_modules/bluebird/js/release/async.js:17:14)
npm verb stack at runCallback (timers.js:789:20)
npm verb stack at tryOnImmediate (timers.js:751:5)
npm verb stack at processImmediate [as _immediateCallback] (timers.js:722:5)
npm verb cwd /Users/me/git/aws-sdk-js-perf
npm verb Darwin 17.5.0
npm verb argv "/usr/local/bin/node" "/usr/local/bin/npm" "install" "--verbose" "aws-sdk-js"
npm verb node v8.9.2
npm verb npm v5.8.0
npm ERR! code E404
npm ERR! 404 Not Found: aws-sdk-js@latest
npm verb exit [ 1, true ]
npm ERR! A complete log of this run can be found in:
npm ERR! /Users/me/.npm/_logs/2018-05-24T10_30_55_688Z-debug.log
I came across instances where other people experienced this but the below seemed to resolve their issue. It doesn't fix mine:
npm set registry http://registry.npmjs.org/
Does anybody know what might be wrong?
Solution 1:[1]
Had the same issue, and this comment here fixed it for me:
Try to remove 'package-lock.json' file from directory where 'package.json' locate.
Solution 2:[2]
Simply follow the following given steps:
npm config set registry http://registry.npmjs.org/ --global
npm cache clear --force
- Delete your package-lock.json file(it will automatically get created after npm i).
- Now try for
npm install
This worked for me.
Solution 3:[3]
This problem happens also when you have a very slow connection
Solution 4:[4]
Even after removing package-lock.json, npm i
didn't worked for us. Instead, it got stuck on another message - still removeObsoleteDep removing fs-extra from the tree as its been replaced by a newer version
.
Problem was, we used yarn occasionally. Installing using yarn
will resolve the issue if it is the case.
Solution 5:[5]
I had this problem and the issue was that my VPN connection dropped and some of the packages were in my companies private package store.
Solution 6:[6]
I also faced the same issue. In my case git://
port was blocked and npm install
took too long to time out. (longer than normal it waits before concluding that the process hung.)
A solution was to auto-rewrite all git://
URLs to https://
:
Run the following command in your terminal
git config --global url."https://".insteadOf git://
npm install
Hope this helps!!
Solution 7:[7]
In my case, changing VPN worked.
Solution 8:[8]
You might not have package-lock.json
so instead of this file you need to remove the npm-shrinkwrap.json
file and try to execute npm install
again.
About npm-shrinkwrap.json:
npm-shrinkwrap.json is a file created by npm-shrinkwrap. It is identical to package-lock.json , with one major caveat: Unlike package-lock.json , npm-shrinkwrap.json may be included when publishing a package.
Solution 9:[9]
I experienced this, and had removed my package-lock.json and found out that a resource wasn't available on the network I was on.
Solution 10:[10]
I had same problem.
When I tried yarn, I got this message:
[1/4] Resolving packages... info There appears to be trouble with your network connection. Retrying...
One of the packages was not available actually!
Solution 11:[11]
The only thing that helped me is commenting out the proxy
& https-proxy
lines at .npmrc
file.
I don't even know how and when those two lines were set. Don't remember myself doing it.
Solution 12:[12]
I had faced this issue too. Cause : proxy was not set.
Use these commands to set your proxy: npm config set proxy http://username:password@host:port npm config set https-proxy http://username:password@host:port. proxy=http://username:password@host:port https-proxy=http://username:password@host:port https_proxy=http://username:password@host:port
Post this, npm install went through with no issues
Solution 13:[13]
I am able to solve it in 2 ways
- Delete 'package-lock.json'
- Remove proxy settings (http_proxy / https_proxy) from environment variables
Solution 14:[14]
In my case package-lock.json file didn't exists. I tried with my mobile hotspot and it worked. Might be some issue from wifi end. But my internet was working fine on wifi. Just issue was it got stuck on
loadIdealTree:loadAllDepsIntoIdealTree: sill install loadIdealTree
Moving on different network can also resolve your issue. I know it is very weird. Hope this will help too. To someone in future.
Solution 15:[15]
In my case, I check the config about registry again.
npm get registry
And check this IP is working.
cuz' I find that I was setting something else like http://10.1.1.1
--- the self-registry like Verdaccio who's proxy here, but it's shutdown.
and I set again npm set registry https://registry.npmjs.org
,
then it's work.
Solution 16:[16]
This is my process:
npm install --verbose
=> Understand better what got hung. Got stuck atloadAllDepsIntoIdealTree
- Removed
package-lock.json
from the same location aspackage.json
=> got stuck atFetchMetadata
- Do
ssh-add
, add in my key like this suggestion => SUCCESS
Solution 17:[17]
Had the same issue. For me it was caused by a webpack watcher. Stopping the watcher instantly advances the process.
Solution 18:[18]
if you still have trouble with this for windows users especially. U can start with re-install your npm in C:/yourfolder .
Solution 19:[19]
I've tried removing the package-lock.json
file but that did not work.
In the end updating node on my Mac to the latest version fixed the issue.
Solution 20:[20]
I use my own npm repo for some modules, and when it was down, the npm i
just hangs.
Solution 21:[21]
In my case i had corrputed my npm config while trying a few other things.
i had added a cafile property
removed it using
npm config edit
Solution 22:[22]
For me the issue went away as soon as I disconnect from my company's VPN.
Solution 23:[23]
So for my case it was a bugy latest version of node with npm.
I rocomande you to always check if you are on a LTS (Long Time Support) version since this ones are daily maintained and stable version.
I was using node without nvm so my first step was to remove it (purge it) it's a simple topic and you can get lot of solution on google depending on your OS.
Then I had to install mvn, you can also use it tutorial of install who uses Curl: in case you get a curl issue dont worry first open the curl install script on browser and copy past it on a folder in an install.sh file, dont forget to make it executable sudo chmod +x myInstall.sh
then you can run it in your terminal
Once nvm installed you may get an issue where nvm is enable to find the remote repository, dont worry all you have to do is to add a file containing this line :
sudo nano ~/.curlrc # use this or vim to create the source file
-k # put this as content and save
Now your nvm should be fine
To install a stable version use the following commande to search repos for LTS versions
nvm ls-remote | grep LTS
Choose any version you want for my case for example
nvm install v16.13.0
Now you will see that node got installed with a corresponding version of npm (I dont recommande updating npm in this case to avoid latest version issues )
Go ahaid and do your npm install xxxx@xxxx
this should work just fine
Dont forget to read your project requirement and choose corresponding node and npm version.
nvm can switch current version of node and npm, go ahaid and read it documentation using nvm --help
Solution 24:[24]
Just execute the following code in your node js cmd:
git config --global http.sslVerify false
npm install
This worked for me.
Solution 25:[25]
This was my issue. I forget that I had previously setup an internal proxy for work to get Node modules. To check whether you are behind a proxy and see your proxy settings do:
npm config list
Mine output was:
https-proxy = "http://9.116.33.175/max*emphasized text*"
To clear it do:
npm config delete proxy
npm config delete http-proxy
npm config delete https-proxy
Sources
This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.
Source: Stack Overflow