Angular 9 ng new stuck at installing packages

15,045

Solution 1

  1. Run command npm i -g npm@latest
  2. 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

Share:
15,045
siddharth shah
Author by

siddharth shah

Updated on June 28, 2022

Comments

  • siddharth shah
    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
      TheViralGriffin about 4 years
      at 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
      siddharth shah about 4 years
      Now, I am waiting for more than 30 minutes to download it. How let me try to cancel it doing npm I.
    • siddharth shah
      siddharth shah about 4 years
      Yes it worked. But we need to find a reason why it didn't work during my new😀
    • GaurangDhorda
      GaurangDhorda about 4 years
      reinstall 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
      Mohamad Alhamid almost 4 years
      I sloved this issue, could you checkout my answer https://stackoverflow.com/a/62499802/8297550
  • Etienne
    Etienne over 3 years
    I'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
    Toto Briac over 3 years
    My connection is slow and I am facing the same issue. I just have to wait a little longer.