'npm install freezes and shows idealTree:chatting: sill idealTree buildDeps

npm freezes when I am installing anything. Even after deleting package-lock.json nothing changed. Here is a similar question. Can anyone tell how can I solve this problem??

enter image description here



Solution 1:[1]

It could be your having an issue with your certificates. Sometimes if you get this behavior there is an error in the certificate chain.

Try npm set strict-ssl false to see if this resolves your issue. Just remember if you do this you have disabled some of the security ssl gives you.

Solution 2:[2]

In my case it was a regresion in npm v7.x related to dependencies pointing to specific gitlab url:

"devDependencies": {
  "npm-seven-issue-dep": "git+ssh://[email protected]/klesun/npm-seven-issue-dep#5f1b313978986974d4364585e6bd3689276f1697"
}

Here is the bug report.

From what I observe, this freeze takes around 60 seconds (some network timeout perhaps) then installation finishes successfully.

Solution 3:[3]

Updating my npm using npm install -g npm@latest solved the issue.

Solution 4:[4]

Use it:

npm install passport --legacy-peer-deps

Solution 5:[5]

I tried all the solutions I found on the Internet: removing the proxy, setting the ssl cert to false, removing node_modules, removing the package-lock... nothing worked...

Then, I updated my WSL Ubuntu 20.04 to 22.04 and it worked!

sudo apt update
sudo apt upgrade
sudo apt dist-upgrade
sudo apt install update-manager-core
sudo nano /etc/update-manager/release-upgrades

change the Prompt value to Prompt = lts

sudo do-release-upgrade -d
cat /etc/os-release

for more info see this link

Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source
Solution 1 Damo
Solution 2 Klesun
Solution 3 Caio Wilson
Solution 4 Muslim
Solution 5 Pedro Bernardos