1

No matter how many times i tried... i can't install Angular CLI on my computer...

I'm using:

npm install -g @angular/cli

And this is the console error log:

C:\Users\Félix Bejarano\AppData\Roaming\npm\ng -> C:\Users\Félix Bejarano\AppData\Roaming\npm\node_modules\@angular\cli\bin\ng
npm ERR! path C:\Users\Félix Bejarano\AppData\Roaming\npm\node_modules\@angular\cli\node_modules\fsevents\node_modules
npm ERR! code EPERM
npm ERR! errno -4048
npm ERR! syscall lstat
npm ERR! Error: EPERM: operation not permitted, lstat 'C:\Users\Félix Bejarano\AppData\Roaming\npm\node_modules\@angular\cli\node_modules\fsevents\node_modules'
npm ERR! { Error: EPERM: operation not permitted, lstat 'C:\Users\Félix Bejarano\AppData\Roaming\npm\node_modules\@angular\cli\node_modules\fsevents\node_modules'
npm ERR! stack: 'Error: EPERM: operation not permitted, lstat \'C:\\Users\\Félix Bejarano\\AppData\\Roaming\\npm\\node_modules\\@angular\\cli\\node_modules\\fsevents\\node_modules\'',
npm ERR! errno: -4048,
npm ERR! code: 'EPERM',
npm ERR! syscall: 'lstat',
npm ERR! path: 'C:\\Users\\Félix Bejarano\\AppData\\Roaming\\npm\\node_modules\\@angular\\cli\\node_modules\\fsevents\\node_modules' }
npm ERR!
npm ERR! Please try running this command again as root/Administrator.
npm ERR! A complete log of this run can be found in:
npm ERR! C:\Users\Félix Bejarano\AppData\Roaming\npm-cache\_logs2018円-03-27T22_56_59_735Z-debug.log

Any help?

R. Richards
25.2k10 gold badges67 silver badges65 bronze badges
asked Mar 27, 2018 at 23:32
5
  • 2
    Have you tried running this command again as root/Administrator, like the error message says? Commented Mar 27, 2018 at 23:34
  • Yes i did, at least five times Commented Mar 27, 2018 at 23:46
  • as in opening a command prompt as Administrator and trying the install from there? You can also try to nuke C:\\Users\\Félix Bejarano\\AppData\\Roaming\\npm\\node_modules\\@angular and then running again Commented Mar 27, 2018 at 23:49
  • Nuke? What is that? Commented Mar 27, 2018 at 23:51
  • you could try adding sudo infront of the command or --forceat the end of the command so sudo npm install -g @angular/cli or npm install -g @angular/cli --force Commented Mar 28, 2018 at 0:00

2 Answers 2

1

Try this in a windows command line:

First create a directory called npm-global or something directly under C:\ with the same user OR create this under your user name. C:\users\myuserId. Side note:- the é character in your username C:\Users\Félix Bejarano could a problem - I don't know.

Run following command in a Command window - (for bash etc you adjust the paths)

npm config --global set prefix c:\npm-global\npm

then

npm config --global set cache C:\npm-global\npm-cache

This will get you a clean folder that you have access to.

answered Mar 28, 2018 at 0:16
Sign up to request clarification or add additional context in comments.

1 Comment

it worked after 3 years, thanks
0

If you have homebrew installed then you can use,

brew install angular-cli
answered Apr 18, 2018 at 14:15

Comments

Your Answer

Draft saved
Draft discarded

Sign up or log in

Sign up using Google
Sign up using Email and Password

Post as a guest

Required, but never shown

Post as a guest

Required, but never shown

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

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.