Vaishnavi Deshpande
Vaishnavi Deshpande

Reputation: 37

Angular8 node js and npm installation problems

I'm learning angular js. For this I've install nodejs and git. And I've run following command on CMD:

  npm install -g @angular/cli@latest

After some time following error occurred

npm WARN rollback Rolling back @schematics/[email protected] failed (this is 
probably harmless): EPERM: operation not permitted, lstat 'C:\Users\User 
Name\AppData\Roaming\npm\node_modules\@angular\cli\node_modules\@schematics'
npm ERR! code EEXIST
npm ERR! path C:\Users\User 
Name\AppData\Roaming\npm\node_modules\@angular\cli\bin\ng
npm ERR! dest C:\Users\User Name\AppData\Roaming\npm\ng.ps1
npm ERR! EEXIST: file already exists, cmd shim 'C:\Users\Chaitanya 
Kulkarni\AppData\Roaming\npm\node_modules\@angular\cli\bin\ng' -> 
'C:\Users\Chaitanya Kulkarni\AppData\Roaming\npm\ng.ps1'
npm ERR! File exists: C:\Users\User Name\AppData\Roaming\npm\ng.ps1
npm ERR! Remove the existing file and try again, or run npm
npm ERR! with --force to overwrite files recklessly.
npm ERR! A complete log of this run can be found in:
npm ERR!     C:\Users\User Name\AppData\Roaming\npm-cache\_logs\2020-01- 
04T12_12_30_922Z-debug.log

Can you please explain what is that error and how I could solve this. I am using Window 10.

Upvotes: 2

Views: 8199

Answers (5)

Zahirul Haque
Zahirul Haque

Reputation: 1649

Run this commands and manually delete the exist files if does not work.

Completely uninstall angular-cli from your machine

npm uninstall -g angular-cli

Clean npm cache

npm cache clean --force

Reinstall angular cli,

npm i @angular/cli@latest -g

Delete this file going to the location.

C:\Users\Chaitanya Kulkarni\AppData\Roaming\npm\ng.ps1

Upvotes: 2

User 1426833
User 1426833

Reputation: 81

In the terminal navigate to the following path: C:\Users\UserName\AppData\Roaming\npm\node_modules and delete angular file and reinstall cli. That worked for me.

Also do check if you've set your path variables correctly.

Upvotes: 0

Samantha Garcia
Samantha Garcia

Reputation: 510

Try to run following command in terminal

npm install -g @angular/cli@latest --force

Upvotes: 0

Vikas Keskar
Vikas Keskar

Reputation: 1248

Perform following steps:

  1. Completely uninstall angular-cli from your machine
    npm uninstall -g angular-cli

  2. Clean npm cache
    npm cache clean --force

  3. Reinstall angular cli,
    npm i @angular/cli@latest -g

Upvotes: 4

Ritesh Ganjewala
Ritesh Ganjewala

Reputation: 121

You can try opening the Command Prompt with Administrator privileges and then run the command.

Upvotes: 0

Related Questions