Error: EPERM: operation not permitted, mkdir ‘D:\Program Files\nodejs\node_cache\_cacache‘

安装vue时,出现如下错误:
E:\QianDuan\Vue3>npm install -g @vue/cli
npm ERR! code EPERM
npm ERR! syscall mkdir
npm ERR! path D:\Program Files\nodejs\node_cache_cacache
npm ERR! errno -4048
npm ERR! Error: EPERM: operation not permitted, mkdir ‘D:\Program Files\nodejs\node_cache_cacache’
npm ERR! [OperationalError: EPERM: operation not permitted, mkdir ‘D:\Program Files\nodejs\node_cache_cacache’] {
npm ERR! cause: [Error: EPERM: operation not permitted, mkdir ‘D:\Program Files\nodejs\node_cache_cacache’] {
npm ERR! errno: -4048,
npm ERR! code: ‘EPERM’,
npm ERR! syscall: ‘mkdir’,
npm ERR! path: ‘D:\Program Files\nodejs\node_cache\_cacache’
npm ERR! },
npm ERR! isOperational: true,
npm ERR! errno: -4048,
npm ERR! code: ‘EPERM’,
npm ERR! syscall: ‘mkdir’,
npm ERR! path: ‘D:\Program Files\nodejs\node_cache\_cacache’
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.
在这里插入图片描述解决方法:
1、删除C:\Users{你的用户文件夹}/目录中的.npmrc文件,一般为隐藏,记得选中“隐藏的项目”。
在这里插入图片描述2、用管理员模式运行cmd。
在这里插入图片描述

  • 17
    点赞
  • 20
    收藏
    觉得还不错? 一键收藏
  • 10
    评论
引用和引用[2]中的错误信息都表明了一个相同的问题,即在执行操作时出现了"Error: EPERM: operation not permitted"的错误。这个错误通常是因为操作系统不允许对某些文件或目录进行操作。提示中还提到了可能的原因:文件可能已被其他程序使用(例如文本编辑器或杀毒软件),或者您缺少对文件的访问权限。 根据引用中的描述,可以看出解决这个问题的一种方法是更改安装目录的权限。您可以右键点击安装目录(例如"D:\Program Files\nodejs\node_cache\_cacache")并选择"属性",然后进入"安全"选项卡,点击"编辑"按钮。在弹出的对话框中,您可以为当前用户添加适当的权限,如读取、写入和执行。 对于您提到的具体路径"D:\Program Files\nodejs\node_cache\_cacache\index-v5\5b\6b",既然是同样的错误,可能是相同的问题导致的。您可以尝试按照上述方法更改目录权限来解决这个问题。如果问题仍然存在,还可以尝试以管理员身份运行命令或使用命令提示符来执行操作。 总结起来,"Error: EPERM: operation not permitted"错误通常是由于操作系统不允许对文件或目录进行操作所引起的。您可以尝试更改相应文件或目录的权限来解决这个问题。如果问题仍然存在,您还可以尝试以管理员身份运行命令或使用命令提示符来执行操作。<span class="em">1</span><span class="em">2</span><span class="em">3</span> #### 引用[.reference_title] - *1* [npm ERR! code EPERM npm ERR! syscall open npm ERR! path C:\Program Files\nodejs\node_cache\_cacache\](https://download.csdn.net/download/weixin_38663701/14040568)[target="_blank" data-report-click={"spm":"1018.2226.3001.9630","extra":{"utm_source":"vip_chatgpt_common_search_pc_result","utm_medium":"distribute.pc_search_result.none-task-cask-2~all~insert_cask~default-1-null.142^v93^chatsearchT3_1"}}] [.reference_item style="max-width: 33.333333333333336%"] - *2* [npm安装报Error: EPERM: operation not permitted, mkdir ‘D:\Program Files\nodejs\node_cache\_cacache](https://blog.csdn.net/weixin_43803387/article/details/127602848)[target="_blank" data-report-click={"spm":"1018.2226.3001.9630","extra":{"utm_source":"vip_chatgpt_common_search_pc_result","utm_medium":"distribute.pc_search_result.none-task-cask-2~all~insert_cask~default-1-null.142^v93^chatsearchT3_1"}}] [.reference_item style="max-width: 33.333333333333336%"] - *3* [解决: Error: EPERM: operation not permitted, mkdir ‘C:\Program Files\nodejs\node_cache\_cacache](https://blog.csdn.net/he_xin2009/article/details/124629140)[target="_blank" data-report-click={"spm":"1018.2226.3001.9630","extra":{"utm_source":"vip_chatgpt_common_search_pc_result","utm_medium":"distribute.pc_search_result.none-task-cask-2~all~insert_cask~default-1-null.142^v93^chatsearchT3_1"}}] [.reference_item style="max-width: 33.333333333333336%"] [ .reference_list ]

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论 10
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值