4

node -v

v4.5.0

npm -v

5.0.1

Has anyone faced this kind of issue while installing angular-cli in windows 10?

Tân
  • 1
  • 15
  • 56
  • 102
Rの卄IT
  • 85
  • 1
  • 3
  • 13

5 Answers5

12

Try the following:

step 0: run this command

npm uninstall -g @angular/cli
npm cache clean

step 1: delete this folder: C:\Users\%YOUR-USERNAME%\AppData\Roaming\npm

step 2: uninstall Nodejs from Windows

step 3: restart your PC

step 4: install a fresh copy of Nodejs from here: https://nodejs.org/en/

step 5: install the CLI globally

npm install -g @angular/cli@latest
Martijn Pieters
  • 1,048,767
  • 296
  • 4,058
  • 3,343
Hamed Baatour
  • 6,664
  • 3
  • 35
  • 47
4

try this :

$ npm remove -g angular-cli
$ npm cache clean
$ npm install -g angular-cli
Mohamed Ali RACHID
  • 3,245
  • 11
  • 22
2

Check the path(npm -v, node -v)ie for Setting Path variable https://stackoverflow.com/a/32159233/4720950

User Variable C:\Users\Username\AppData\Roaming\npm 
System Variable C:\Program Files\nodejs

Restart System & update,clean npm https://stackoverflow.com/a/45020014

npm install npm@latest -g
npm cache clean

Uninstall prev angular cli and then install angular cli again

npm uninstall -g angular-cli
npm install -g @angular/cli
Parameshwar
  • 856
  • 8
  • 16
2

I had this problem recently running on a Windows box.

To solve: using gitbash:

npm uninstall -g @angular/cli
npm cache verify

uninstall node using the uninstall option on the Windows menu > Node using gitbash: cd ~/AppData/Roaming rm -rf npm rm -rf npm-cache

RESTART WINDOWS : You must restart windows

reinstall node.js

npm i @angular/cli -g

That worked.

Gabe
  • 21
  • 2
0
  1. Delete c:/users/{accountname}/AppData/Roaming/npm/node_modules/@angular
  2. Delete c:/users/{accountname}/AppData/Roaming/npm/ng
  3. Delete c:/users/{accountname}/AppData/Roaming/npm/ng.cmd
  4. Delete c:/users/{accountname}/AppData/Roaming/npm/ng.ps1
  5. run this command in cmd

npm install -g @angular/cli