问题描述

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. 【分析笔记】Linux I2C-Tools 使用踩坑笔记

    一.踩坑缘由 在调试 I2C 器件时,我一般习惯于使用 i2cdetect 工具来确认芯片是否有应答,通常有应答之后,就会开始着手移植或者编写对应的驱动程序,但是在调试 sgp41 传感器时却不灵了. ...

  2. drf-day4——序列化类常用字段和字段参数、序列化类source用法、序列化类定制字段返回内容的两种方式、序列化类的多表关联反序列化保存、反序列化字段校验、ModelSerializer的使用

    目录 一.序列化类常用字段和字段参数(了解) 1.1 常用字段类 1.2 常用字段参数 选项参数: 通用参数: 重点 二.序列化高级用法之source(了解) 2.1 序列化定制字段名字 三.序列化高 ...

  3. 11月25日内容总结——sql查询关键字

    目录 一.SQL语句查询关键字 二.前期数据准备 三.编写SQL语句的小技巧 四.查询关键字之where筛选 1.查询id大于等于3小于等于6的数据 2.查询薪资是20000或者18000或者1700 ...

  4. Vue 26 plugins

    1 简介 它是用来增强vue的.它是包含install方法的一个对象,install的第一个参数是Vue,第二个以后参数是插件使用者传入的参数 插件里面可以配置全局过滤器.全局指令.混入.Vue原型上 ...

  5. zookeeper04---ZAB协议

    转https://www.jianshu.com/p/2bceacd60b8a 1.什么是Zab协议 1.1Zab协议简介 1.2 Zab 协议的特性(怎么保持数据一致性) 2.Zab 协议实现的作用 ...

  6. git分支的一些处理情况记录

    一.开发分支(dev)上的代码更新后,要合并到 master 分支 git checkout dev #切换到dev分支 git pull #将远程更新的代码同步到本地 git checkout ma ...

  7. windows下dapr的代码调试--非docker部署

    上一篇大概的整理了一下在vm虚拟机下通过docker部署dapr应用,作服务之间调用的例子. 今天整理一下windows下dapr的非docker部署调试,毕竟大部分开发不需要花费太多时间做部署. 源 ...

  8. axios实现跨域的问题 vue实现跨域

    第一次写博客,主要是记录自己的一些新的,不好的地方忘各位多多指点,请不要吐槽: 按踩坑顺序叙述.本人对http了解太少,所以坑踩得较多. 1.开始进行跨域时,知道vue2.0官方推荐axios进行aj ...

  9. 【KAWAKO】audiotsm-使用python对音频进行变速不变调处理

    目录 安装库 导入相关库 定义reader 定义writer 定义WSLOA算法,并运行 官方手册 源码 安装库 pip install audiotsm 导入相关库 import audiotsm ...

  10. Openfoam UPstream类探索

    前言 上篇文章我们大体捋顺了Pstream类,但上篇没有讲到的是Pstream类很多东西是从UPstream类继承来的 这次我们大体看一下UPstream类,以避免Pstream类内很多继承来的东西不 ...