angular-cli icon indicating copy to clipboard operation
angular-cli copied to clipboard

Stuck forever at "Installing packages for tooling via npm"

Open esafwan opened this issue 10 years ago • 30 comments

OS?

Mac OSX Sierra

Versions.

angular-cli: 1.0.0-beta.18 node: 6.9.1

Repro steps.

When I start new project by using ng new project, its quickly finishes all the first steps and get stuck at the line below:

Successfully initialized git. Installing packages for tooling via npm.

I left it for close to an hour and nothing happened. So I terminated the command and tried ng serve, it seems to work. So what could be the problem? I am not getting any error messages too.

esafwan avatar Nov 06 '16 07:11 esafwan

That's a npm message. When you do ng new project, the CLI runs npm install after creating the project files. The message you see is from npm, and there isn't much we can do about it.

Maybe there's something wrong with your npm install? You can also try doing ng new project --skip-npm and it won't run npm install afterwards, and you can do it manually.

filipesilva avatar Nov 16 '16 17:11 filipesilva

Did you try sudo ng new project on Mac? Keep in mind that node install can take a while

MladenJanjetovic avatar Dec 14 '16 11:12 MladenJanjetovic

Apparently, the latest version for ng cli uses --skip-install instead of --skip-npm.

That resolved the issue for me though...

acidjames avatar Feb 13 '17 23:02 acidjames

thanks @acidjames , I was struggling with that --skip-npm. @filipesilva, about the Installing packages for tooling via npm failing problem.. I'm having it too, and I think it might be a permission problem related to the ng user, because if go into the folder created by ng new and execute $ npm install it works without any problem and $ ng serve will run properly

Limcap avatar Feb 13 '17 23:02 Limcap

I came here because I had the same issue. it seems it just takes a long time. After waiting awhile then googling the issue and switching back to my console it said Installed packages for tooling via npm. and Project 'xxx' successfully created. So it should eventually work :)

LiamKenneth avatar Feb 15 '17 14:02 LiamKenneth

I can confirm @LiamKenneth comment, waiting simply resolves the "issue". The process gets finished and the message gets shown that notifies you about the successful project creation.

mnemanja avatar Feb 26 '17 12:02 mnemanja

Although, what's taking it so long? Also a new issue should be created to show some sort of progress so it's clear it's doing something and hasn't just crashed.

LiamKenneth avatar Feb 26 '17 20:02 LiamKenneth

@esafwan I also had this same issue. I have resolved in three steps (1) Node version updated (2) used comment : ng new project --skip-install (3) Made disk space enough for installation.

prnl-jagadeesh avatar Mar 22 '17 09:03 prnl-jagadeesh

why not just verbose the creation so people dont wonder what's going on (btw, with the latest version (1.0.0-beta.28.3) it works with --skip-npm...--skip-install having the install wait forever)

phil123456 avatar Mar 29 '17 13:03 phil123456

thank you for this --skip-install command 👍

jomajoms avatar May 22 '17 15:05 jomajoms

I had a similar issue. First, when creating a new angular project via command
$ng new projectName, it was spitting the error below.

Successfully initialized git. Installing packages for tooling via yarn. ERROR: [Errno 2] No such file or directory: 'install'

Package install failed, see above.

I was able to resolve this error by the command, $ npm install -g yarnpkg

Then finally after issuing the command $ ng new mainProject

it took a very long time but finally it worked as shown below. Successfully initialized git. Installing packages for tooling via yarn. Installed packages for tooling via yarn. Project 'mainProject' successfully created.

I agree with @LiamKenneth and @mnemanja that waiting resolves the issue.

jkimathi avatar Jun 15 '17 20:06 jkimathi

I successfully got this message Successfully initialized git. Installing packages for tooling via yarn. Installed packages for tooling via yarn. Project 'mainProject' successfully created.

but the directory was empty , any ideas about that ?

AhmedHamedTN avatar Jun 28 '17 17:06 AhmedHamedTN

I am not seeing "Successfully initialized git." at all. I see only "Installing packages for tooling via npm" and it hangs there forever

aquacg avatar Jul 05 '17 23:07 aquacg

no need to worry much guys.... It worked, you just need to be a little patient, just give it few minutes if you have updated your npm, I have to wait roughly about 10 minutes and then I got

Installing packages for tooling via npm. Wait 10 minutes Installed packages for tooling via npm. Successfully initialized git. Project 'my-app' successfully created.

classic9 avatar Aug 20 '17 13:08 classic9

Need to wait to get this installed. It takes time to create project. There is no issue.

shahrishabhptechnical avatar Aug 21 '17 17:08 shahrishabhptechnical

These steps resolved the issue for me:

  1. ng new ProjectName --skip-npm
  2. cd ~/ProjectName
  3. npm install

node v6.11.2 npm v3.10.10 angular-cli: 1.0.0-beta.28.3

skorotaev avatar Aug 21 '17 22:08 skorotaev

Be patient you might have to wait few minutes it'll get installed and following message will appear . Installing packages for tooling via npm. Installed packages for tooling via npm. Directory is already under version control. Skipping initialization of git.

DanushkaAmith avatar Sep 13 '17 06:09 DanushkaAmith

Can someone work on pairing down the number of dependencies needed? Waiting 10 minutes for creation of a new project to "test something out" is crazy IMO.

westlakem avatar Sep 25 '17 20:09 westlakem

A simple Hello Angular projects is 200+ MBs in size and looking at task manger I can say npm seems to be working really hard. Fun part is I used to think Android Studio is slow but now Android Studio can create new project on my PC quicker than npm.

hiteshsahu avatar Oct 29 '17 16:10 hiteshsahu

I guess many people are facing this issue. Really a frustrating experience from NG CLI. Now even angular 5.x has released but such issues still remain!

so I have it figured out it now and there are TWO main reasons for this

  1. Totally Installation size of even a simple Hello World project (running via ng new hello-world) is around 180-200 Mb. So it depends on your internet speed which might be having connectivity issues (may be from the npm server side ! )
  2. You need to run command from Administrator privileges.

vibs2006 avatar Nov 05 '17 13:11 vibs2006