问题
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?
回答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.
回答2:
If you have homebrew installed then you can use,
brew install angular-cli
来源:https://stackoverflow.com/questions/49523934/cant-install-angular-cli