Reputation: 15928
I am trying to create a new Angular2 app using
ng new myAppName
This hangs on the line
/ Installing packages for tooling via npm
Its been sitting there for about an hour.
The previous time this happend I killed the process and tried re-running
ng new xxx
That failed because angular cli had some reference to the app name somewhere and thats whay I had to choose a new app name.
How do I get around this?
Upvotes: 18
Views: 15062
Reputation: 139
I was having similar issue while setting up Angular on windows 10. It was getting stuck while installing dependencies after all the CREATE's were done for the first application. For me this was happening because I was running the command from my laptop sitting at home and was connected to company VPN. When I disconnected from VPN and commented out the proxy settings in .npmrc ( it was needed for npm to work via corporate network ) the issue got resolved.
Upvotes: 0
Reputation: 11
The main reason for this is because the npm tries to install the dependencies.
You can skip to install the dependencies right now. And then install them later by using following command :
ng new myAppName --skip--install
and then go to myAppName and run npm install
cd myAppName
npm install
After all the dependencies are installed. Now you can start you application using :
npm start
For more info please read the following thread : https://github.com/angular/angular-cli/issues/3032
Upvotes: 0
Reputation: 4042
I had the same problem. Just waited a bit longer and finally it create the project. So, be patient!
Upvotes: 1
Reputation: 15573
To fix this issue run
ng new myAppName --skip-install
then in command line go to the new project folder
cd myAppName
then run
npm install
This fixed the problem for me.
The second way is to just press Ctrl + C at the time it hangs on
Installing packages for tooling via npm
and the go to the project folder and run npm install
Upvotes: 1
Reputation: 583
I was having the same issue. I resolved by using yarn. Follow below steps
Install yarn through npm using the below command
npm install yarn --global
Create your application using ng new
but skip installing packages using the below command. You can install them manually using yarn
ng new project-name --skip-install
cd project-name
yarn install
This will install your dependencies super-fast
Upvotes: 21
Reputation: 1
I had the same problem. I waited a little longer and it said Installed packages for tooling via npm.
Checkout this issue on github for the same:
https://github.com/angular/angular-cli/issues/3032
Running it with --skip-install
or --skip-npm
worked for some.
ng new myAppName --skip-install
Upvotes: 0
Reputation: 597
I actually had the same problem, which was resulted by a VERY slow net connection
"Installing packages for tooling via npm." downloads and installs the tool so it migth take few minutes
If you are installing on Linux you need to install angular-cli without root permissions https://docs.npmjs.com/getting-started/fixing-npm-permissions
You probably need to delete the new project directory created, on linux run "rm -rf myprojectname" where myprojectname stands for the name of your project
Upvotes: 0
Reputation: 10832
If you're not getting an error, delete the node_modules and require then anew by npm install
. In my case, after that I saw an actual error message which was:
Error encountered resolving symbol values statically. Function calls are not supported. Consider replacing the function or lambda with a reference to an exported function (position 39:16 in the original .ts file), resolving symbol AppModule in /..../app/app.module.ts
, after defining a factory for a provider in my module.
Maybe this will help someone.
Upvotes: 0
Reputation: 63
1) Uninstall the angular-cli
sudo npm uninstall -g angular-cli
2) Try cache clean
npm cache clean
3) Install angular-cli
sudo npm install -g angular-cli
Upvotes: 0
Reputation: 1395
Some people install angular-cli
using root user (sudo) because on some systems using a regular user will cause a permission error. But his may cause further problems like the one you are facing.
To fix it:
1) Remove your global angular-cli (using sudo):
sudo npm uninstall -g angular-cli
2) Follow the instructions on page below to fix npm permissions:
https://docs.npmjs.com/getting-started/fixing-npm-permissions
3) Reinstall angular-cli, this time not using sudo:
npm install -g angular-cli
Upvotes: 1
Reputation: 1440
Try to install the last version of node.js because according to angular 2 site :
If Node.js and npm aren't already on your machine, install them. Our examples require node v5.x.x or higher and npm 3.x.x or higher. To check which version you are using, run node -v and npm -v in a terminal window.
Upvotes: 0
Reputation: 36
Try npm cache clean
If angular cli already installed, run ng new command
ng new xxx
Hope this helps.
Thanks, Jasmin
Upvotes: 1