解决 Internal Error: EPERM: operation not permitted, open

nodejs(我的version:16.17)安装yarn时,执行命令:corepack enable 后,报错:Internal Error: EPERM: operation not permitted, open 'Y:\nodejs-v16.17.0-x64\pnpm,不允许执行该操作,想到了以前用linux普通用户执行rm -rf /*也会提示不允许执行操作,而换成root(管理员)账户才能拥有更高权限执行命令,所以猜测应该是同样的问题,于是尝试用管理员身份运行cmd命令窗口,再次执行命令:corepack enable,便成功了:

在这里插入图片描述

在这里插入图片描述

PS D:\酒店预订\xm-hotel-manager\vue> npm i npm error code EPERM npm error syscall open npm error path D:\ns\node_cache\_cacache\index-v5\ae\cb\7c962421f0da92fc4dbb8f92fe10d9492fff205c3578e6c892f0e881c0e2 npm error errno -4048 npm error Error: EPERM: operation not permitted, open 'D:\ns\node_cache\_cacache\index-v5\ae\cb\7c962421f0da92fc4dbb8f92fe10d9492fff205c3578e6c892f0e881c0e2' npm error at async open (node:internal/fs/promises:638:25) npm error at async writeFile (node:internal/fs/promises:1212:14) npm error at async Object.insert (D:\ns\node_modules\npm\node_modules\cacache\lib\entry-index.js:134:5) npm error at async CacheEntry.store (D:\ns\node_modules\npm\node_modules\make-fetch-happen\lib\cache\entry.js:308:7) npm error at async fetch (D:\ns\node_modules\npm\node_modules\make-fetch-happen\lib\fetch.js:98:7) npm error at async RegistryFetcher.packument (D:\ns\node_modules\npm\node_modules\pacote\lib\registry.js:90:19) npm error at async RegistryFetcher.manifest (D:\ns\node_modules\npm\node_modules\pacote\lib\registry.js:128:23) npm error at async #fetchManifest (D:\ns\node_modules\npm\node_modules\@npmcli\arborist\lib\arborist\build-ideal-tree.js:1202:20) npm error at async #nodeFromEdge (D:\ns\node_modules\npm\node_modules\@npmcli\arborist\lib\arborist\build-ideal-tree.js:1040:19) npm error at async #buildDepStep (D:\ns\node_modules\npm\node_modules\@npmcli\arborist\lib\arborist\build-ideal-tree.js:904:11) { npm error errno: -4048, npm error code: 'EPERM', npm error syscall: 'open', npm error path: 'D:\\ns\\node_cache\\_cacache\\index-v5\\ae\\cb\\7c962421f0da92fc4dbb8f92fe10d9492fff205c3578e6c892f0e881c0e2', npm error requiredBy: '.' npm error } npm error npm error The operation was rejected by your operating system. npm error It's possible that the file was already in use (by a text editor or antivirus), npm error or that you lack permissions to access it. npm error npm error If you believe this might be a p
04-03
PS D:\酒店预订\xm-hotel-manager> cd vue PS D:\酒店预订\xm-hotel-manager\vue> npm i npm error code EPERM npm error syscall open npm error path D:\ns\node_cache\_cacache\index-v5\ae\cb\7c962421f0da92fc4dbb8f92fe10d9492fff205c3578e6c892f0e881c0e2 npm error errno -4048 npm error Error: EPERM: operation not permitted, open 'D:\ns\node_cache\_cacache\index-v5\ae\cb\7c962421f0da92fc4dbb8f92fe10d9492fff205c3578e6c892f0e881c0e2' npm error at async open (node:internal/fs/promises:638:25) npm error at async writeFile (node:internal/fs/promises:1212:14) npm error at async Object.insert (D:\ns\node_modules\npm\node_modules\cacache\lib\entry-index.js:134:5) npm error at async CacheEntry.store (D:\ns\node_modules\npm\node_modules\make-fetch-happen\lib\cache\entry.js:308:7) npm error at async fetch (D:\ns\node_modules\npm\node_modules\make-fetch-happen\lib\fetch.js:98:7) npm error at async RegistryFetcher.packument (D:\ns\node_modules\npm\node_modules\pacote\lib\registry.js:90:19) npm error at async RegistryFetcher.manifest (D:\ns\node_modules\npm\node_modules\pacote\lib\registry.js:128:23) npm error at async #fetchManifest (D:\ns\node_modules\npm\node_modules\@npmcli\arborist\lib\arborist\build-ideal-tree.js:1202:20) npm error at async #nodeFromEdge (D:\ns\node_modules\npm\node_modules\@npmcli\arborist\lib\arborist\build-ideal-tree.js:1040:19) npm error at async #buildDepStep (D:\ns\node_modules\npm\node_modules\@npmcli\arborist\lib\arborist\build-ideal-tree.js:904:11) { npm error errno: -4048, npm error code: 'EPERM', npm error syscall: 'open', npm error path: 'D:\\ns\\node_cache\\_cacache\\index-v5\\ae\\cb\\7c962421f0da92fc4dbb8f92fe10d9492fff205c3578e6c892f0e881c0e2', npm error requiredBy: '.' npm error } npm error npm error The operation was rejected by your operating system. npm error It's possible that the file was already in use (by a text editor or antivirus), npm error or that you lack permissions to access it. npm error npm error If you believe this might be a permissions issue, please double-check the npm error permissions of the file and its containing directories, or try running npm error the command again as root/Administrator. npm error Log files were not written due to an error writing to the directory: D:\ns\node_cache\_logs npm error You can rerun the command with `--loglevel=verbose` to see the logs in your terminal 在idea中
04-03
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值