如何解决angular-cli未更新,并且ng服务无法正常工作
我想更新我的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缓存,但这没关系。
解决方法
您是否正在运行任何角度应用程序?尝试重新启动系统,然后再次运行命令。 这些文件可能已被正在运行的应用锁定,从而导致您在上面看到错误。
版权声明:本文内容由互联网用户自发贡献,该文观点与技术仅代表作者本人。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌侵权/违法违规的内容, 请发送邮件至 dio@foxmail.com 举报,一经查实,本站将立刻删除。