Stuck forever at "Installing packages for tooling via npm"
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.
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.
Did you try sudo ng new project on Mac? Keep in mind that node install can take a while
Apparently, the latest version for ng cli uses --skip-install instead of --skip-npm.
That resolved the issue for me though...
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
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 :)
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.
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.
@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.
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)
thank you for this --skip-install command 👍
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.
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 ?
I am not seeing "Successfully initialized git." at all. I see only "Installing packages for tooling via npm" and it hangs there forever
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.
Need to wait to get this installed. It takes time to create project. There is no issue.
These steps resolved the issue for me:
- ng new ProjectName --skip-npm
- cd ~/ProjectName
- npm install
node v6.11.2 npm v3.10.10 angular-cli: 1.0.0-beta.28.3
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.
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.
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.
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
- 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 ! ) - You need to run command from Administrator privileges.