问题描述

Windows system32>npm installg npm

2335 error code EEXIST
2336 error path D:\Program Files\nodejs\npm.cmd
2337 error Refusing to delete D:\Program Files\nodejs\npm.cmd: is outside D:\Program Files\nodejs\node_modules\npm and not a link
2338 error File exists: D:\Program Files\nodejs\npm.cmd
2339 error Remove the existing file and try again, or run npm
2340 error with --force to overwrite files recklessly.

A complete log of this run can be found in: ERRc:\Users\abc\AppData Roaming npm-cache logs\2022-12-13T06 02 45 049Z-debug.log

C: Windows system32>npm install npm -g --force

3451 error code EPERM
3452 error syscall rename
3453 error path C:\Windows\system32\node_modules\npm\node_modules\.node-gyp.DELETE\node_modules\@npmcli
3454 error dest C:\Windows\system32\node_modules\npm\node_modules\node-gyp\node_modules\@npmcli
3455 error errno -4048
3456 error Error: EPERM: operation not permitted, rename 'C:\Windows\system32\node_modules\npm\node_modules\.node-gyp.DELETE\node_modules\@npmcli' -> 'C:\Windows\system32\node_modules\npm\node_modules\node-gyp\node_modules\@npmcli'
3456 error  [OperationalError: EPERM: operation not permitted, rename 'C:\Windows\system32\node_modules\npm\node_modules\.node-gyp.DELETE\node_modules\@npmcli' -> 'C:\Windows\system32\node_modules\npm\node_modules\node-gyp\node_modules\@npmcli'] {
3456 error   cause: [Error: EPERM: operation not permitted, rename 'C:\Windows\system32\node_modules\npm\node_modules\.node-gyp.DELETE\node_modules\@npmcli' -> 'C:\Windows\system32\node_modules\npm\node_modules\node-gyp\node_modules\@npmcli'] {
3456 error     errno: -4048,
3456 error     code: 'EPERM',
3456 error     syscall: 'rename',
3456 error     path: 'C:\\Windows\\system32\\node_modules\\npm\\node_modules\\.node-gyp.DELETE\\node_modules\\@npmcli',
3456 error     dest: 'C:\\Windows\\system32\\node_modules\\npm\\node_modules\\node-gyp\\node_modules\\@npmcli'
3456 error   },
3456 error   errno: -4048,
3456 error   code: 'EPERM',
3456 error   syscall: 'rename',
3456 error   path: 'C:\\Windows\\system32\\node_modules\\npm\\node_modules\\.node-gyp.DELETE\\node_modules\\@npmcli',
3456 error   dest: 'C:\\Windows\\system32\\node_modules\\npm\\node_modules\\node-gyp\\node_modules\\@npmcli',
3456 error   parent: 'npm'
3456 error }
3457 error The operation was rejected by your operating system.
3457 error It's possible that the file was already in use (by a text editor or antivirus),
3457 error or that you lack permissions to access it.
3457 error
3457 error If you believe this might be a permissions issue, please double-check the
3457 error permissions of the file and its containing directories, or try running
3457 error the command again as root/Administrator.

解决方案:

npm config set prefix "D:\nodejs\node_global"

npm config set cache "D:\nodejs\node_cache"

参考文档:https://blog.csdn.net/qq_31989047/article/details/108755783

分析原因:估计是原来装过nodejs,然后系统权限发生过变更,原有文件夹失去了权限.

这个问题折磨了我,2天,哭死.

npm升级报错,没有权限.ERRERR!The operation was rejected by your operating system. npm ERR!Error: EPERM: operation not permitted, rename的更多相关文章

  1. npm ERR! { Error: EPERM: operation not permitted, mkdir 'C:\Program Files\nodejs\node_cache\_locks'

    vue项目安装json-server报错npm ERR!  { Error: EPERM: operation not permitted, mkdir 'C:\Program Files\nodej ...

  2. "npm ERR! Error: EPERM: operation not permitted"问题解决

    在基于macaca进行自动化测试的时候,遇到如下问题: E:\AutoTest\Macaca\LocalTEST\macaca-test-sample\macaca-test>macaca do ...

  3. 全局安装npm包报错没有权限

    背景:npm i npm-check -g 时报错没有权限 Error: EACCES: permission denied, access '/usr/local/lib/node_modules' ...

  4. npm install 安装报错:npm ERR! EPERM npm ERR! -4048 npm ERR! Error: EPERM: operation not permitted, unlink 'D:\test\demo\code\materialT\node_modules\.staging'

    更新项目依赖包,删除掉package-lock.json.node_modules,运行npm install,报如上错误信息,查询资料说是没有权限,本人用管理员身份打开powershell,运行np ...

  5. npm ERR! Error: EPERM: operation not permitted

    转载于:https://blog.csdn.net/qq_36772866/article/details/86934950 win10 在npm install时报错 解决方案 删除node-mou ...

  6. pip升级报错(权限问题)

    今天跟新pip的时候错一个接一个 看到拒绝访问应该是权限的问题,想起安装的时候选择谁可以使用软件(大概是这样的一个选项),选择了“只有我”,选择所有用户应该就不会存在这个问题了,那么怎么解决呢? 敲黑 ...

  7. WSL中使用npm install报错

    报错内容类似下面的格式.具体解决方法请看这里:https://github.com/Microsoft/WSL/issues/14 着重关注 https://github.com/Microsoft/ ...

  8. 巨坑npm run dev 报错 终于找到正确答案 Error: EPERM: operation not permitted, open '/data/public/build/css/add.p

    Windows10环境 npm run dev 报错  终于找到正确答案 Error: EPERM: operation not permitted, open '/data/public/build ...

  9. npm install 报错(npm ERR! errno -4048,Error: EPERM: operation not permitted,)解决方法

    npm ERR! path E:\SouthernPowerGridProject\web_project\AutoOPS\autoops\node_modules\fsevents\node_mod ...

  10. npm报错没有权限

    在npm install经常会报错没有权限 这个时候需要清除一下缓存 npm cache clean --force

随机推荐

  1. P19_数据绑定

    数据绑定 数据绑定的基本原则 在 data 中定义数据 在 WXML 中使用数据 在 data 中定义页面的数据 在页面对应的 .js 文件中,把数据定义到 data 对象中即可: Mustache ...

  2. 易语言 CS1.6单机开源

    一个绘制 一个修改器 垃圾玩意 https://kxd.lanzoul.com/iJiwf07ve61a https://kxd.lanzoul.com/iTT4n07w61tg

  3. slate源码解析(一)- 序言

    笔者从大学时期就开始接触的前端,在刚去实习的时候就被导师安排去做内网的一个小富文本工具.之后从毕业后干的第一份工作游戏客户端,到现在做着可视化相关的前端工作,都有在做富文本相关的内容.可以说是和富文本 ...

  4. python 操作 WhiteSpace 语言

    python 操作 WhiteSpace语言 目录 python 操作 WhiteSpace语言 1 WhiteSpace 简介 2 Python 操作栈流程 1 WhiteSpace 简介 Whit ...

  5. CCRD_TOC_2007_EULAR专辑_2

    中信国健临床通讯 EULAR 2007专辑II 目录 类风湿关节炎 1 Etanercept联合MTX治疗RA导致炎症与骨破坏进展之间的失关联也见于单关节水平:来自TEMPO的研究数据 Landewe ...

  6. 在 Ubuntu 22 的基础上进行 Hadoop 伪分布式(HDFS)的搭建

    一.使用VMware安装Ubuntu虚拟机 在Linux系统各个发行版中,Ubuntu系统在服务端和桌面端使用占比最高,网络上资料最是齐全,所以这里使用Ubuntu LTS. 整体的系统安装文件较大( ...

  7. .NET静态代码织入——肉夹馍(Rougamo) 发布1.4.0

    肉夹馍(https://github.com/inversionhourglass/Rougamo)通过静态代码织入方式实现AOP的组件,其主要特点是在编译时完成AOP代码织入,相比动态代理可以减少应 ...

  8. Django中多数据库的配置,实现分库分表,主从复制,读写分离

    在django项目中, 一个工程中存在多个APP应用很常见. 有时候希望不同的APP连接不同的数据库,这个时候需要建立多个数据库连接. 1. 修改项目的 settings 配置 在 settings. ...

  9. pytho获取C函数返回值

    python调用C语言接口 注:本文所有示例介绍基于linux平台 在底层开发中,一般是使用C或者C++,但是有时候为了开发效率或者在写测试脚本的时候,会经常使用到python,所以这就涉及到一个问题 ...

  10. SQLServer 编程总结

    case的用途 case语句有四个关键字,缺一不可,分别是:case when then end,另外还有一个else.case 后面跟字段名(当在when后面出现字段名时,case里不能写出来),w ...