Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

npm install error ( npm install -g angular-cli ) in windows 10

node -v

v4.5.0

npm -v

5.0.1

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

like image 575
Rohit Yadav Avatar asked Jun 07 '17 15:06

Rohit Yadav


People also ask

Will npm install install angular cli?

When you running npm install the Angular CLI gets installed locally for your project. Then, when you run npm start or npm run ng <your command> it will kick off. Then when you run ng <command> in your project directory, for commands like scaffolding - ng g <params> or ng update the global CLI will be in use.

Why npm is not working on Windows?

The Npm command not found error can appear when you install or upgrade npm. On Windows, the cause of this error could be that a PATH or system variable is not correctly set. The error can also occur if you do not have npm or Node. js installed, have an outdated version, or have permission issues.


2 Answers

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
like image 94
Hamed Baatour Avatar answered Oct 08 '22 20:10

Hamed Baatour


try this :

$ npm remove -g angular-cli
$ npm cache clean
$ npm install -g angular-cli
like image 45
Mohamed Ali RACHID Avatar answered Oct 08 '22 20:10

Mohamed Ali RACHID