I am trying to work on angular2 for which I have installed nodeJS. I have followed the steps given here https://github.com/angular/angular-cli#prerequisites but there seems to be an issue. Here's what I did in the Command Prompt(Admin):
C:\WINDOWS\system32>node -v
v6.10.1
C:\WINDOWS\system32>npm -v
3.10.10
C:\WINDOWS\system32>npm install -g @angular/cli
[ ..............] / loadRequestedDeps: sill install loadAllDepsIntoIdealTree
My command prompt is stuck at this command and shows no sign of response. I will be glad if there are any suggestions on solving this issue of mine. Is there anything I am missing here?
10 Answers 10
Make sure.,you already installed nodejs.
npm install -g angular-cli
ng help
ng new PROJECT_NAME cd PROJECT_NAME ng serve
ng serve --host 0.0.0.0 --port 4201 --live-reload-port 49153
Comments
This command solved this problem for me:
npm install -g rimraf
The TLS key was a real problem and also install windows-tools does not help. After rimraf and using the right proxy settings and node_modules destination I can install angular-cli.
Comments
Can you try from the users directory C:\Users\userName or PC name just as shown in the below figure, and make sure you're not limited to any network related issues !
https://s-media-cache-ak0.pinimg.com/originals/87/50/24/87502456dd8043729b794bf00ee2c7e7.jpg
2 Comments
Try this -
Global Package :
npm uninstall -g @angular/cli
npm cache clean
npm install -g @angular/cli@latest
Local Package :
rm -rf node_modules dist # use rmdir /S/Q node_modules dist in Windows Command Prompt; use rm -r -fo node_modules,dist in Windows PowerShell
npm install --save-dev @angular/cli@latest
npm install
Comments
I faced the similar problem. Press Ctrl + C in the command Prompt. It will continue and it will not exit.
Comments
- Run "
npm install" inside this project folder to install all dependencies. - Make sure you use the latest version of the CLI (upgrade guide below)
- Run "
ng serve" to see the app in action.
Then,
Run the below commands to upgrade the latest version of the CLI - only use "sudo" on Mac/ Linux.
- sudo
npm uninstall -g angular-cli @angular/cli - sudo
npm install -g @angular/cli
Comments
uninstall node.js
delete all node_modules from your directory
delete npm from AppData>Roaming>
delete npm_cache and all newly generated node files from the c:\users[username} directory.
install node.js
add local path as:
new>PATH>c:\users[username}\AppData\Roaming\npm
keep this before Temp path
in cmd: npm -v node -v C:\Users693272円>npm install -g @angular/cli
ng -v
(here 'ng' error should not come)
and now you can go to some other directory also and create your new project as
everything installed is set globally
C:\Users693272円>cd /
C:>d:
D:>ng new app1 -d
HOPE THIS HELPS!
Comments
Open PowerShell as admin:
- Set-ExecutionPolicy RemoteSigned
- npm cache clean --force
- npm install -g npm@latest
- npm config set registry http://registry.npmjs.org/
- npm install -g @angular/cli --verbose
Comments
Start > Run > AppWiz.cpl > Uninstall node.js
Delete the node install directory removing remaining folders and files
Delete npm folder from Start > Run > %AppData% (AppData\Roaming)
If it exists delete npm-cache from the c:\users[username} directory
Install node.js the Latest Version and please use the default C:\Program Files\nodejs install path.
Open Cmd:
C:\Users\Jeremy>node -v
v17.1.0
C:\Users\Jeremy>npm -v
8.1.2
Comments
Nmp via Nvm without node case:
In my case, I had installed npm via nvm on fresh Windows, without installing node first.
The Fix
- Uninstall all npm versions.
- Install node.
- Install npm via nvm again.
Angular Cli installation and all other npm commands worked fine after.
-verboseto see verbose logsnpm install -g @angular/cli -verboseit'll tell you what exactly it's stuck on. some additional things to try: turn off antivirus if you have any, if you are on vpn try disconnecting.