Angular 9 ng new stuck at installing packages
Solution 1
- Run command
npm i -g npm@latest
- Run command
npm i -g @angular/cli@latest
It worked for me.
Solution 2
Every time you create a new project the angular suppose to download huge chunks of file of size around 500mb, all the time that is been taken is actually the time taken to download those file in the background. A good internet connection is the solution.
Solution 3
I changed directory and then run these command and it worked for me
sudo npm cache clean --force
sudo npm cache verify
sudo npm i npm@latest -g
ng new my-project
Another Solution:
Cancel the installing packages with ctrl+c
and then go to the files of project and run command npm install
This also worked for me
siddharth shah
Updated on June 28, 2022Comments
-
siddharth shah almost 2 years
I have just installed the node version 12.16.1 the LTS and angular cli version 9.0.3. At the time of creating new project with cli all files in root folder are generating but it is stuck at the part of installing node packages.
Is anybody facing the same issue? Please help how can we resolve it.
-
TheViralGriffin about 4 yearsat times it takes some time to install all the packages, if you feel like stuck you can cancel and do npm install again and give it a try.
-
siddharth shah about 4 yearsNow, I am waiting for more than 30 minutes to download it. How let me try to cancel it doing npm I.
-
siddharth shah about 4 yearsYes it worked. But we need to find a reason why it didn't work during my new😀
-
GaurangDhorda about 4 yearsreinstall node.. then set node path environment variable in windows system, reinstall angular CLI with
-g
global. and checkout some of the firewall or anti-virus system that can block some of services during installation.. these are some of the points you need to take care. -
Mohamad Alhamid almost 4 yearsI sloved this issue, could you checkout my answer https://stackoverflow.com/a/62499802/8297550
-
-
Etienne over 3 yearsI'm starting with angular I hope you don't have to download all those packages for every app you want to create that would be ridiculous...
-
Toto Briac over 3 yearsMy connection is slow and I am facing the same issue. I just have to wait a little longer.