4

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?

6
  • If there is not network problems, I think you just have to wait for the download. Commented Mar 29, 2017 at 1:02
  • Hi @Pengyy, I have no network issues. I have waited for an hour now and then posted this issue here to seek some help Commented Mar 29, 2017 at 1:10
  • have you tried to reach npmjs.com/package/@angular/cli form your browser? Commented Mar 29, 2017 at 1:20
  • Yes, I have. I am waiting for a response. github.com/angular/angular-cli/issues/5727 Commented Mar 29, 2017 at 1:29
  • @VisheshSingh looks like a network issue, you might want to try -verbose to see verbose logs npm install -g @angular/cli -verbose it'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. Commented Mar 30, 2017 at 14:06

10 Answers 10

4

Make sure.,you already installed nodejs.

  1. npm install -g angular-cli

  2. ng help

  3. ng new PROJECT_NAME cd PROJECT_NAME ng serve

  4. ng serve --host 0.0.0.0 --port 4201 --live-reload-port 49153

Sign up to request clarification or add additional context in comments.

Comments

2

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

1

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

That did not help either. Its stuck at the same thing
angular.io/docs/ts/latest/cli-quickstart.html please try these you might succeed
1

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

0

I faced the similar problem. Press Ctrl + C in the command Prompt. It will continue and it will not exit.

Comments

0
  1. Run "npm install" inside this project folder to install all dependencies.
  2. Make sure you use the latest version of the CLI (upgrade guide below)
  3. 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.

  1. sudo npm uninstall -g angular-cli @angular/cli
  2. sudo npm install -g @angular/cli

Comments

0

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:\Users\693272>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:\Users\693272>cd /

C:>d:

D:>ng new app1 -d

HOPE THIS HELPS!

Comments

0

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

0
  1. Start > Run > AppWiz.cpl > Uninstall node.js

  2. Delete the node install directory removing remaining folders and files

  3. Delete npm folder from Start > Run > %AppData% (AppData\Roaming)

  4. If it exists delete npm-cache from the c:\users[username} directory

  5. Install node.js the Latest Version and please use the default C:\Program Files\nodejs install path.

  6. Open Cmd:


C:\Users\Jeremy>node -v
v17.1.0

C:\Users\Jeremy>npm -v
8.1.2

Comments

0

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.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.