Npm install makes Windows crash - npm

Generally when I run npm install sometimes my pc crashes and shows the screen like the image below. I’ve tried removing both the package-lock.json and node_modules. I’ve also run the commands npm rebuild -g and npm cache clean -f.
2 days ago I reinstalled my pc to fabric settings and it still doesn’t help.
I’m using WSL, nodejs v12.10.0 and npm 6.10.3.
Anyone knows what’s up and could help me?
https://imgur.com/a/762AdrR

Update
I've been using yarn instead of npm since 3 months back and this problem has never occured again. So if you are experiencing the same problem as me, try it out.

Related

npm install -g eas-cli fails

I am a newbie to react-native and would like to start developing a react-native app.
I could have started developing by react-native-cli, but I heard there was something called Expo and a way to open an initial app with expo-cli.
I copied and pasted this code npm install -g eas-cli, but it gave me a huge long error message I put its screenshot below.
I have no idea about the system?? inside my computer.
I would be so grateful if anyone gives me a possible solution.
Thanks for your valuable time^^
=========== Edit ===========
So I read the first comment, and run this command on my Mac brew install nvm. It worked nicely and looked for more information for what to do from this point. Then I ran this command mkdir ~/.nvm, and I am stack now. I created a directory called .nvm, but so what from now??
Thanks a lot for taking your time to help me!!
You probably installed npm using sudo, or something like that.
I would recommend to install npm using nvm. It usually removes all those errors.

Installing freeCodecamp locally hangs when I get to the npm ci step

I've been trying to install freeCodeCamp repo locally coz I'm doing the Full-stack curriculum and I am in a remote area where the grid is not reliable.
I've got the repo on my compute already. I've also installed MongoDB and Nodejs and Npm, following instructions and steps posted on Github by the freeCodeCamp Team. When I get to the step where dependencies need to be installed using "npm ci", the progress bar runs untill halfway, then it stops forever (sometimes it freezes the whole system).
I've tried with Git Bash, Powershell, and Powershell ISE with same results. I did uninstall and re-install Nodejs and NPM a couple of times for no avail. The versions are Node v16.17.0 and Npm 8.18.0.
Any HELP will be appreciated.
I'm having similar issues with v16.17.0 and npm v8.18.0. Downgrading to v8.13.0 seemed to fix it for me but I can't find any previously raised issues as to why this may be the case.
To downgrade:
npm i -g npm#8.13.0 && npm install
Seems to occur from v8.14.0 onwards

NPM stuck on idealTree: timing idealTree

Today i decided to start react native cli project. Everything works great since i want to add new lib of course using npm . So i ran npm install ... . And this command always stuck on
Image
idealTree: timing idealTree Completed in 3440ms
And nothing happened. So i tried to ran
npm install --verbose
And again stuck on the same place. Also clear cache npm cache clear --force and nothing happened again. I don'n know how to fix this
I have had npm install freeze on me numerous times, lately. I'm not sure of the cause. When that happens I follow these steps:
Kill the npm install process with ctrl+c.
Delete node_modules. If there are files that you cannot delete because they are currently in use, that may mean that the npm install process was not successfully stopped. Try opening Task Manager and ending all nodejs and terminal processes. If this fails, restart your pc and then delete node_modules
Clean cache and reinstall node_modules with npm cache clean --force && npm i
This has happened to me a few times before and all I had to do was kill my dev server before running npm install.
Hope that helps as well!
I had the same issue on node latest version v18.8.0 and npm v8.18.0, I just downgraded to node 16.6 using nvm and it worked fine.
For me, the issue was that I had node running for a separate project. Terminating the other node process fixed the issue.
When i opened my package.json i saw '~2.2.1' in front of react-native-gesture-handler which probably means that it was notinstalled properly
Just close all terminals and then open task manager and kill all the processes corresponding to NodeJS. Then install it again.
Hopefully it will resolve.
I also faced this problem and the solution was simple by stopping all the "nodejs terminals" that are working outside.
When you stop nodeJS Terminals running in the background, it will complete the current installation process.
enter image description here
When you want to add package on your project it is better to stop server before adding new package.
I had same problem but after doing this it is solved.

yarn no longer present

Been running my npm start, which uses yarn, over and over for the last 5 months and has been working since day dot. I even see it in my Terminal history 10 lines above.
> yarn
yarn install v1.10.1
I killed my npm start process a moment ago, and now for some reason, I get this...
> yarn
sh: yarn: command not found
Yarn is no longer installed on my system...for some reason. So I installed it and get the usual information that it's installed.
$ npm -g install yarn
+ yarn#1.12.3
added 1 package in 2.786s
But yarn still isn't installed and I'm still getting the same above issue.
I haven't done anything that would have messed up yarn in anyway (no installing/updating/removing of any packages), so I'm completely stumped as to what the heck happened.
Has anyone had this issue, know what it is and has a fix?
After a bit of playing around, it seems that killing yarn in the process of it doing it's update, killed it's global link (e.g. /usr/bin/yarn) to it's binary.
So I ran the yarn application from it's full path, which I got from the npm install -g yarn (in my case /usr/local/Cellar/node/10.12.0/bin/yarn).
This then updated yarn, reinstalling the links and fixing it, and now it's all working. :)

How to stop angular-cli freezing on "loadRequestedDeps: silly install loadAllDepsIntoIdealTree"?

I am running Windows 8.1 with node version 7.7.3 and npm version 4.1.2.
I have been working on an Angular tutorial without issues. At some point since finishing that tutorial I installed Python. I am not sure if it is related, but I have mentioned it just in case.
Today I am trying to create an Angular application and it hung without completing.
I did some research and it tells me to do this:
npm uninstall -g #angluar/cli
npm cache clean
npm install -g #angular/cli
The last command hangs at this point:
loadRequestedDeps: silly install loadAllDepsIntoIdealTree
I opened the command prompt "run as administrator" to run these commands.
Everything I try fails. I have connected to a completely different network to eliminate that as the problem and that didn't fix anything. I have uninstalled and reinstalled node.js and that hasn't fixed the problem either.
I can ping registry.npmjs.org just fine.
What is causing this error?
I finally found the answer! I ran the following command in the command window:
echo %temp%
It had 3 temp paths in there. I removed the two I didn't need and voila, it works!