【发布时间】:2020-10-07 07:29:58
【问题描述】:
我想更新我的 angular-cli。我正在使用:
npm install -g @angular/cli
但我收到此控制台错误:
npm WARN deprecated request@2.88.2: request has been deprecated, see https://github.com/request/request/issues/3142
npm WARN deprecated har-validator@5.1.5: this library is no longer supported
npm ERR! path C:\Users\Saeed\AppData\Roaming\npm\ng
npm ERR! code EPERM
npm ERR! errno -4048
npm ERR! syscall open
npm ERR! Error: EPERM: operation not permitted, open 'C:\Users\Saeed\AppData\Roaming\npm\ng'
npm ERR! { [Error: EPERM: operation not permitted, open 'C:\Users\Saeed\AppData\Roaming\npm\ng']
npm ERR! cause:
npm ERR! { Error: EPERM: operation not permitted, open 'C:\Users\Saeed\AppData\Roaming\npm\ng'
npm ERR! errno: -4048,
npm ERR! code: 'EPERM',
npm ERR! syscall: 'open',
npm ERR! path: 'C:\\Users\\Saeed\\AppData\\Roaming\\npm\\ng' },
npm ERR! stack:
npm ERR! 'Error: EPERM: operation not permitted, open \'C:\\Users\\Saeed\\AppData\\Roaming\\npm\\ng\'',
npm ERR! errno: -4048,
npm ERR! code: 'EPERM',
npm ERR! syscall: 'open',
npm ERR! path: 'C:\\Users\\Saeed\\AppData\\Roaming\\npm\\ng' }
npm ERR!
npm ERR! The operation was rejected by your operating system.
npm ERR! It's possible that the file was already in use (by a text editor or antivirus),
npm ERR! or that you lack permissions to access it.
npm ERR!
npm ERR! If you believe this might be a permissions issue, please double-check the
npm ERR! permissions of the file and its containing directories, or try running
npm ERR! the command again as root/Administrator (though this is not recommended).
npm ERR! A complete log of this run can be found in:
npm ERR! C:\Users\Saeed\AppData\Roaming\npm-cache\_logs\2020-10-07T07_21_17_386Z-debug.log
然后当我想运行 ng serve 时,我得到了这些错误:
bash: /c/Users/Saeed/AppData/Roaming/npm/ng: Permission denied
我该怎么办?有什么帮助吗?
我也删除了npm缓存,不过没关系。
【问题讨论】:
标签: angular npm angular-cli npm-install