siddharth shah
siddharth shah

Reputation: 1147

Angular 9 ng new stuck at installing packages

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.

Upvotes: 5

Views: 27381

Answers (6)

Sunny Singh
Sunny Singh

Reputation: 41

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

Upvotes: 1

gorsyntora
gorsyntora

Reputation: 1

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

Upvotes: 0

Rudy Vissers
Rudy Vissers

Reputation: 5477

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.

Upvotes: 0

Zohab Ali
Zohab Ali

Reputation: 9574

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

Upvotes: 5

priyanshu bindal
priyanshu bindal

Reputation: 346

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.

Upvotes: 4

krishna  Chikhale
krishna Chikhale

Reputation: 43

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

It worked for me.

Upvotes: 4

Related Questions