问题描述

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. Dubbo 入门系列之基于 Dubbo API 开发微服务应用

    目标 从零上手开发基于 Dubbo 的微服务 难度 低 环境要求 系统:Windows.Linux.MacOS JDK 8 及以上(推荐使用 JDK17) Git IntelliJ IDEA(可选) ...

  2. Vue19 常用指令及自定义指令

    部分转自:https://blog.csdn.net/weixin_58032613/article/details/122759818 1 常用指令 1) v-bind 单向数据绑定 https:/ ...

  3. java2022.7.9

    知识点

  4. 字符串(str)内置方法补充、列表(list)内置方法、可变类型与不可变类型、队列和栈

    目录 一.字符串(str)的内置方法(补充) 了解方法 二.列表(list)的内置方法 三.可变类型与不可变类型 四.队列和栈 一.字符串(str)的内置方法(补充) # upper()把当前字符串中 ...

  5. MFC中的RTTI(Runtime Type Identification, 运行时类型识别)详解(参考《深入浅出MFC》)

    在MFC中的RTTI的实现,主要是利用一个名为CRuntimeClass的结构来链接各个"有关系的类"的信息来实现的.简单来说,就是在需要用到RTTI技术的类内建立CRuntime ...

  6. fixed 定位元素超出内容 overflow 不滚动

    假如,一个父元素的定位是 fixed,其所有子元素的高度加起来超过了父元素,父元素设置 overflow: auto.有可能出现不滚动的问题,发生的情况有横向和竖向的. 竖向滚动:必须要设置父元素的高 ...

  7. LeetCode-429 N叉树的层次遍历

    来源:力扣(LeetCode)链接:https://leetcode-cn.com/problems/n-ary-tree-level-order-traversal著作权归领扣网络所有.商业转载请联 ...

  8. 自己动手从零写桌面操作系统GrapeOS系列教程——8.x86介绍

    由于GrapeOS目前只支持x86,所以本讲我们简单的介绍一下x86. 百度百科上是这样介绍的:x86泛指一系列基于Intel 8086且向后兼容的中央处理器指令集架构. 中央处理器就是我们平时说的C ...

  9. jquery获得标签元素

    一.根据元素name值获取元素 $("元素[name="name的值"]"); 例子:1.$("a[name="apoint"]& ...

  10. leetcode 30. 串联所有单词的子串 【时间击败 90.28%】 【内存击败 97.44%】

    这道题让我从早做到晚-3--- 设len=words[0].length(). 一开始我按照words的顺序扩大区间,发现这样就依赖words的顺序.之后改成遍历s的所有长度为len*words.le ...