找回密码
 立即注册
查看: 3434|回复: 3

npm install -g @vue/cli报权限错误

[复制链接]

43

主题

30

回帖

251

积分

管理员

积分
251
发表于 2024-8-17 10:36:14 | 显示全部楼层 |阅读模式


C:\Users\momo>npm install -g @vue/cli
npm ERR! code EPERM
npm ERR! syscall open
npm ERR! path C:\Program Files (x86)\node-v21.6.0-win-x64\node_cache\_cacache\tmp\e07ce2fd
npm ERR! errno -4048
npm ERR! Error: EPERM: operation not permitted, open 'C:\Program Files (x86)\node-v21.6.0-win-x64\node_cache\_cacache\tmp\e07ce2fd'
npm ERR!  [Error: EPERM: operation not permitted, open 'C:\Program Files (x86)\node-v21.6.0-win-x64\node_cache\_cacache\tmp\e07ce2fd'] {
npm ERR!   errno: -4048,
npm ERR!   code: 'EPERM',
npm ERR!   syscall: 'open',
npm ERR!   path: 'C:\\Program Files (x86)\\node-v21.6.0-win-x64\\node_cache\\_cacache\\tmp\\e07ce2fd'
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! Log files were not written due to an error writing to the directory: C:\Program Files (x86)\node-v21.6.0-win-x64\node_cache\_logs
npm ERR! You can rerun the command with `--loglevel=verbose` to see the logs in your terminal

则将此目录给与权限


然后再执行:
npm install -g @vue/cli



本帖子中包含更多资源

您需要 登录 才可以下载或查看,没有账号?立即注册

×

43

主题

30

回帖

251

积分

管理员

积分
251
 楼主| 发表于 2024-8-17 10:40:42 | 显示全部楼层

43

主题

30

回帖

251

积分

管理员

积分
251
 楼主| 发表于 2024-8-17 10:41:01 | 显示全部楼层

43

主题

30

回帖

251

积分

管理员

积分
251
 楼主| 发表于 2024-8-17 11:27:55 | 显示全部楼层
先清空缓存:
npm cache clean --force
再执行安装:
npm install -g @vue/cli
您需要登录后才可以回帖 登录 | 立即注册

本版积分规则

QQ|Archiver|手机版|小黑屋|上海录客智能科技 ( 沪ICP备17017717号-8 )|网站地图

GMT+8, 2024-12-22 13:15 , Processed in 0.133415 second(s), 26 queries .

Powered by Discuz! X3.5

Copyright © 2001-2020, Tencent Cloud.

快速回复 返回顶部 返回列表