npm WARN checkPermissions Missing write access to C:\Users\zhang\AppData\Roaming\npm\node_modules\@a

解决Angular CLI全局安装问题
本文介绍了在全局安装Angular CLI时遇到的权限错误,并提供了解决方案,包括删除原有node_modules文件夹及重新安装的具体步骤。

npm WARN checkPermissions Missing write access to C:\Users\zhang\AppData\Roaming\npm\node_modules\@angular\cli\node_modules\camelcase
npm WARN checkPermissions Missing write access to C:\Users\zhang\AppData\Roaming\npm\node_modules\@angular\cli\node_modules\kind-of
npm WARN checkPermissions Missing write access to C:\Users\zhang\AppData\Roaming\npm\node_modules\@angular\cli\node_modules\fsevents
npm WARN checkPermissions Missing write access to C:\Users\zhang\AppData\Roaming\npm\node_modules\@angular\cli\node_modules\source-map
npm ERR! path C:\Users\zhang\AppData\Roaming\npm\node_modules\@angular\cli\node_modules\camelcase
npm ERR! code ENOENT
npm ERR! errno -4058
npm ERR! syscall access
npm ERR! enoent ENOENT: no such file or directory, access 'C:\Users\zhang\AppData\Roaming\npm\node_modules\@angular\cli\node_modules\camelcase'
npm ERR! enoent This is related to npm not being able to find a file.
npm ERR! enoent

npm ERR! A complete log of this run can be found in:
npm ERR!     C:\Users\zhang\AppData\Roaming\npm-cache\_logs\2018-09-03T06_37_14_187Z-debug.log

===================================================================================

以上错误是重新全局安装angular-cli的时候出现的:
npm uninstall -g @angular/cli
npm cache verify
npm install -g @angular/cli@6.1.5 -save-dev

 

解决方法:

1)删除原有的node_modules文件夹,即C:\Users\zhang\AppData\Roaming\npm\node_modules

2)重新执行安装命令:npm install -g @angular/cli@6.1.5 -save-dev

C:\Users\shiningtang>npm install -g cnpm --registry=https://registry.npmmirror.com npm WARN notsup Unsupported engine for cnpm@9.4.0: wanted: {"node":">= 14.18.0"} (current: {"node":"12.16.1","npm":"6.13.4"}) npm WARN notsup Not compatible with your version of node/npm: cnpm@9.4.0 npm ERR! code EPERM npm ERR! syscall rename npm ERR! path C:\Users\shiningtang\AppData\Roaming\npm\node_modules\cnpm\node_modules\.make-fetch-happen.DELETE\node_modules\@npmcli npm ERR! dest C:\Users\shiningtang\AppData\Roaming\npm\node_modules\cnpm\node_modules\make-fetch-happen\node_modules\@npmcli npm ERR! errno -4048 npm ERR! Error: EPERM: operation not permitted, rename 'C:\Users\shiningtang\AppData\Roaming\npm\node_modules\cnpm\node_modules\.make-fetch-happen.DELETE\node_modules\@npmcli' -> 'C:\Users\shiningtang\AppData\Roaming\npm\node_modules\cnpm\node_modules\make-fetch-happen\node_modules\@npmcli' npm ERR! [OperationalError: EPERM: operation not permitted, rename 'C:\Users\shiningtang\AppData\Roaming\npm\node_modules\cnpm\node_modules\.make-fetch-happen.DELETE\node_modules\@npmcli' -> 'C:\Users\shiningtang\AppData\Roaming\npm\node_modules\cnpm\node_modules\make-fetch-happen\node_modules\@npmcli'] { npm ERR! cause: [Error: EPERM: operation not permitted, rename 'C:\Users\shiningtang\AppData\Roaming\npm\node_modules\cnpm\node_modules\.make-fetch-happen.DELETE\node_modules\@npmcli' -> 'C:\Users\shiningtang\AppData\Roaming\npm\node_modules\cnpm\node_modules\make-fetch-happen\node_modules\@npmcli'] { npm ERR! errno: -4048, npm ERR! code: 'EPERM', npm ERR! syscall: 'rename', npm ERR! path: 'C:\\Users\\shiningtang\\AppData\\Roaming\\npm\\node_modules\\cnpm\\node_modules\\.make-fetch-happen.DELETE\\node_modules\\@npmcli', npm ERR! dest: 'C:\\Users\\shiningtang\\AppData\\Roaming\\npm\\node_modules\\cnpm\\node_modules\\make-fetch-happen\\node_modules\\@npmcli' npm ERR! }, npm ERR! stack: "Error: EPERM: operation not permitted, rename 'C:\\Users\\shiningtang\\AppData\\Roaming\\npm\\node_modules\\cnpm\\node_modules\\.make-fetch-happen.DELETE\\node_modules\\@npmcli' -> 'C:\\Users\\shiningtang\\AppData\\Roaming\\npm\\node_modules\\cnpm\\node_modules\\make-fetch-happen\\node_modules\\@npmcli'", npm ERR! errno: -4048, npm ERR! code: 'EPERM', npm ERR! syscall: 'rename', npm ERR! path: 'C:\\Users\\shiningtang\\AppData\\Roaming\\npm\\node_modules\\cnpm\\node_modules\\.make-fetch-happen.DELETE\\node_modules\\@npmcli', npm ERR! dest: 'C:\\Users\\shiningtang\\AppData\\Roaming\\npm\\node_modules\\cnpm\\node_modules\\make-fetch-happen\\node_modules\\@npmcli', npm ERR! parent: 'cnpm' npm ERR! } 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. npm ERR! A complete log of this run can be found in: npm ERR! C:\Users\shiningtang\AppData\Roaming\npm-cache\_logs\2025-07-09T09_26_14_401Z-debug.log
07-10
npm warn deprecated inflight@1.0.6: This module is not supported, and leaks memory. Do not use it. Check out lru-cache if you want a good and tested way to coalesce async requests by a key value, which is much more comprehensive and powerful. npm warn deprecated glob@7.2.3: Glob versions prior to v9 are no longer supported npm warn deprecated har-validator@5.1.5: this library is no longer supported npm warn deprecated uuid@3.4.0: Please upgrade to version 7 or higher. Older versions may use Math.random() in certain circumstances, which is known to be problematic. See https://v8.dev/blog/math-random for details. npm warn deprecated rimraf@2.7.1: Rimraf versions prior to v4 are no longer supported npm warn deprecated request@2.88.2: request has been deprecated, see https://github.com/request/request/issues/3142 npm warn deprecated consolidate@0.14.5: Please upgrade to consolidate v1.0.0+ as it has been modernized with several long-awaited fixes implemented. Maintenance is supported by Forward Email at https://forwardemail.net ; follow/watch https://github.com/ladjs/consolidate for updates and release changelog npm warn deprecated coffee-script@1.12.7: CoffeeScript on NPM has moved to "coffeescript" (no hyphen) npm warn cleanup Failed to remove some directories [ npm warn cleanup [ npm warn cleanup '\\\\?\\C:\\Users\\14949\\AppData\\Roaming\\npm\\node_modules\\vue-cli', npm warn cleanup [Error: EPERM: operation not permitted, rmdir 'C:\Users\14949\AppData\Roaming\npm\node_modules\vue-cli\node_modules\rxjs\_esm5'] { npm warn cleanup errno: -4048, npm warn cleanup code: 'EPERM', npm warn cleanup syscall: 'rmdir', npm warn cleanup path: 'C:\\Users\\14949\\AppData\\Roaming\\npm\\node_modules\\vue-cli\\node_modules\\rxjs\\_esm5' npm warn cleanup } npm warn cleanup ], npm warn cleanup [ npm warn cleanup '\\\\?\\C:\\Users\\14949\\AppData\\Roaming\\npm\\node_modules\\vue-cli\\node_modules\\download-git-repo', npm warn cleanup [Error: EPERM: operation not permitted, rmdir 'C:\Users\14949\AppData\Roaming\npm\node_modules\vue-cli\node_modules\download-git-repo\test'] { npm warn cleanup errno: -4048, npm warn cleanup code: 'EPERM', npm warn cleanup syscall: 'rmdir', npm warn cleanup path: 'C:\\Users\\14949\\AppData\\Roaming\\npm\\node_modules\\vue-cli\\node_modules\\download-git-repo\\test' npm warn cleanup } npm warn cleanup ] npm warn cleanup ] npm error code EEXIST npm error path C:\Users\14949\AppData\Roaming\npm\vue.cmd npm error EEXIST: file already exists npm error File exists: C:\Users\14949\AppData\Roaming\npm\vue.cmd npm error Remove the existing file and try again, or run npm npm error with --force to overwrite files recklessly. npm error A complete log of this run can be found in: C:\Users\14949\AppData\Local\npm-cache\_logs\2025-06-19T07_33_35_089Z-debug-0.log
06-20
运行步骤一时出现错误D:\XinDW-cloud\uni-wapNew-home>npm install -g cnpm --registry=https://registry.npm.taobao.org npm WARN rollback Rolling back mkdirp@1.0.4 failed (this is probably harmless): EPERM: operation not permitted, lstat 'E:\node\node_cache\node_modules\cnpm\node_modules\@npmcli\move-file\node_modules' npm WARN rollback Rolling back @npmcli/fs@2.1.2 failed (this is probably harmless): EPERM: operation not permitted, lstat 'E:\node\node_cache\node_modules\cnpm\node_modules\make-fetch-happen\node_modules\@npmcli' npm ERR! code EPERM npm ERR! syscall rename npm ERR! path E:\node\node_cache\node_modules\cnpm\node_modules\.make-fetch-happen.DELETE\node_modules\@npmcli npm ERR! dest E:\node\node_cache\node_modules\cnpm\node_modules\make-fetch-happen\node_modules\@npmcli npm ERR! errno -4048 npm ERR! Error: EPERM: operation not permitted, rename 'E:\node\node_cache\node_modules\cnpm\node_modules\.make-fetch-happen.DELETE\node_modules\@npmcli' -> 'E:\node\node_cache\node_modules\cnpm\node_modules\make-fetch-happen\node_modules\@npmcli' npm ERR! [OperationalError: EPERM: operation not permitted, rename 'E:\node\node_cache\node_modules\cnpm\node_modules\.make-fetch-happen.DELETE\node_modules\@npmcli' -> 'E:\node\node_cache\node_modules\cnpm\node_modules\make-fetch-happen\node_modules\@npmcli'] { npm ERR! cause: [Error: EPERM: operation not permitted, rename 'E:\node\node_cache\node_modules\cnpm\node_modules\.make-fetch-happen.DELETE\node_modules\@npmcli' -> 'E:\node\node_cache\node_modules\cnpm\node_modules\make-fetch-happen\node_modules\@npmcli'] { npm ERR! errno: -4048, npm ERR! code: 'EPERM', npm ERR! syscall: 'rename', npm ERR! path: 'E:\\node\\node_cache\\node_modules\\cnpm\\node_modules\\.make-fetch-happen.DELETE\\node_modules\\@npmcli',npm ERR! dest: 'E:\\node\\node_cache\\node_modules\\cnpm\\node_modules\\make-fetch-happen\\node_modules\\@npmcli' npm ERR! }, npm ERR! errno: -4048, npm ERR! code: 'EPERM', npm ERR! syscall: 'rename', npm ERR! path: 'E:\\node\\node_cache\\node_modules\\cnpm\\node_modules\\.make-fetch-happen.DELETE\\node_modules\\@npmcli', npm ERR! dest: 'E:\\node\\node_cache\\node_modules\\cnpm\\node_modules\\make-fetch-happen\\node_modules\\@npmcli', npm ERR! parent: 'cnpm' npm ERR! } 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. npm ERR! A complete log of this run can be found in: npm ERR! C:\Users\Administrator\AppData\Roaming\npm-cache\_logs\2025-11-07T09_32_40_436Z-debug.log
最新发布
11-08
评论
成就一亿技术人!
拼手气红包6.0元
还能输入1000个字符
 
红包 添加红包
表情包 插入表情
 条评论被折叠 查看
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值