Angular 9 ng new stuck at installing packages

Viewed 17318

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.

6 Answers
  1. Run command npm i -g npm@latest
  2. Run command npm i -g @angular/cli@latest

It worked for me.

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.

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

I had exactly the same problem.

I tried everything. Reinstallation of node several times. Latest version didn't change anything. Stuck at Installing packages (npm)...

I was running node.js within a virtual machine. Only 1 gig of memory was allocated to the VM. Allocating more memory (from 1 gig to 4 gig) solved the problem. if there is not enough memory, node.js does not complain but seems stuck.

I can reproduce the problem. Now with 4 gig instead of 1 gig, ng new app took only 30 seconds.

You can set up one workspace (one folder) for all your applications, by running

ng new your_workspace --create-application false

and then create your new apps inside this workspace

cd your_workspace

ng generate application testApp

Maybe it helps to your needs

I faced the same issue quite a few times. Try using: ng new project_name --skip-install

And then, go to the file and do npm install

Related