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\_logs\2018-03-27T22_56_59_735Z-debug.log

Any help?

R. Richards
  • 24,603
  • 10
  • 64
  • 64

2 Answers2

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.

bhantol
  • 9,368
  • 7
  • 44
  • 81
0

If you have homebrew installed then you can use,

brew install angular-cli
Juan
  • 477
  • 4
  • 8