问题描述

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 中 Zookeeper 注册中心原理分析

    vivo 互联网服务器团队- Li Wanghong 本文通过分析Dubbo中ZooKeeper注册中心的实现ZooKeeperResitry的继承体系结构,自顶向下分析了AbstractRegist ...

  2. 为什么 Linux 需要虚拟内存(转载)

    为什么 Linux 需要虚拟内存 原文链接: https://draveness.me/whys-the-design-os-virtual-memory/ 操作系统中的 CPU 和主内存(Main ...

  3. VUE防止多次点击,重复请求

    1.添加自定义文件 preventReClick.js import Vue from 'vue' const preventReClick = Vue.directive('preventReCli ...

  4. Markdown箭头总汇

    Markdown箭头的汇总 普通箭头 \[\uparrow \] $$\uparrow$$ \[\Uparrow \] $$\Uparrow$$ \[\downarrow \] $$\downarro ...

  5. Vue37 常用的组件库

    1 移动端 vant ui:https://vant-ui.github.io/vant/#/zh-CN (https://vant-ui.github.io/vant/#/zh-CN) cube u ...

  6. Vue13 样式动态绑定

    1 class样式的动态绑定 1.1 说明 通过命令v-bind:class设置一个对象,动态切换class.可以简写为:class. class=""可以和:class=&quo ...

  7. Vue 禁止按钮多次点击 重复提交数据(指令实现)

    全局定义,方便调用 新建plugins.js export default { install (Vue) { // 防重复点击(指令实现) Vue.directive('preventReClick ...

  8. 基于C++的OpenGL 03 之纹理

    1. 概述 本文基于C++语言,描述OpenGL的纹理 前置知识可参考: 基于C++的OpenGL 02 之着色器 - 当时明月在曾照彩云归 - 博客园 (cnblogs.com) 笔者这里不过多描述 ...

  9. 分析总结一下所有有关打印题目的套路和思路:pat乙级:1109 擅长C, 1008元素循环右移,1050 螺旋矩阵,1027 打印沙漏等等

    分析: 首先你要明白第一件事:所有要打印东西的题目打印都是从第一行到最后一行,从第一列到最后一列,你是没办法跳着打印的.可以看看其他几个打印题目1008元素循环右移,1050 螺旋矩阵1027 打印沙 ...

  10. corundum:100GNIC学习(三)——恢复工程

    前文:(一)https://www.cnblogs.com/shroud404/p/15364812.html (二)https://www.cnblogs.com/shroud404/p/15412 ...