首页 > 其他分享 >解决npm i 报错显示 code EPERM syscall rename等问题

解决npm i 报错显示 code EPERM syscall rename等问题

时间:2023-06-10 09:55:04浏览次数:48  
标签:npm rename node ERR modules Program 报错 Files

问题描述:
npm ERR! code EPERM
npm ERR! syscall rename
npm ERR! path D:\Program Files\nodejs\npm_global\node_modules\cnpm\node_modules\npm\node_modules\.node-gyp.DELETE\node_modules\@npmcli
npm ERR! dest D:\Program Files\nodejs\npm_global\node_modules\cnpm\node_modules\npm\node_modules\node-gyp\node_modules\@npmcli
npm ERR! errno -4048
npm ERR! Error: EPERM: operation not permitted, rename 'D:\Program Files\nodejs\npm_global\node_modules\cnpm\node_modules\npm\node_modules\.node-gyp.DELETE\node_modules\@npmcli' -> 'D:\Program Files\nodejs\npm_global\node_modules\cnpm\node_modules\npm\node_modules\node-gyp\node_modules\@npmcli'
npm ERR! [OperationalError: EPERM: operation not permitted, rename 'D:\Program Files\nodejs\npm_global\node_modules\cnpm\node_modules\npm\node_modules\.node-gyp.DELETE\node_modules\@npmcli' -> 'D:\Program Files\nodejs\npm_global\node_modules\cnpm\node_modules\npm\node_modules\node-gyp\node_modules\@npmcli'] {
npm ERR! cause: [Error: EPERM: operation not permitted, rename 'D:\Program Files\nodejs\npm_global\node_modules\cnpm\node_modules\npm\node_modules\.node-gyp.DELETE\node_modules\@npmcli' -> 'D:\Program Files\nodejs\npm_global\node_modules\cnpm\node_modules\npm\node_modules\node-gyp\node_modules\@npmcli'] {
npm ERR! errno: -4048,
npm ERR! code: 'EPERM',
npm ERR! syscall: 'rename',
npm ERR! path: 'D:\\Program Files\\nodejs\\npm_global\\node_modules\\cnpm\\node_modules\\npm\\node_modules\\.node-gyp.DELETE\\node_modules\\@npmcli',
npm ERR! dest: 'D:\\Program Files\\nodejs\\npm_global\\node_modules\\cnpm\\node_modules\\npm\\node_modules\\node-gyp\\node_modules\\@npmcli'
npm ERR! },
npm ERR! stack: "Error: EPERM: operation not permitted, rename 'D:\\Program Files\\nodejs\\npm_global\\node_modules\\cnpm\\node_modules\\npm\\node_modules\\.node-gyp.DELETE\\node_modules\\@npmcli' -> 'D:\\Program Files\\nodejs\\npm_global\\node_modules\\cnpm\\node_modules\\npm\\node_modules\\node-gyp\\node_modules\\@npmcli'",
npm ERR! errno: -4048,
npm ERR! code: 'EPERM',
npm ERR! syscall: 'rename',
npm ERR! path: 'D:\\Program Files\\nodejs\\npm_global\\node_modules\\cnpm\\node_modules\\npm\\node_modules\\.node-gyp.DELETE\\node_modules\\@npmcli',
npm ERR! dest: 'D:\\Program Files\\nodejs\\npm_global\\node_modules\\cnpm\\node_modules\\npm\\node_modules\\node-gyp\\node_modules\\@npmcli',
npm ERR! parent: 'npm'
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.

npm ERR! A complete log of this run can be found in:
npm ERR! D:\Program Files\nodejs\npm_cache\_logs\2023-06-10T01_18_26_519Z-debug.log

 

解决方法:

1、需要删除.npmrc文件(找到用户目录下C:\Users\用户名\.npmrc)。

注意:本人node安装目录为D:\Program Files\nodejs,而D:\Program Files\nodejs\node_modules\npm下也存在.npmrc的文件,删除的不是本目录下的文件,而是删除C盘用户下的.npmrc文件。

2、以管理员身份运行CMD,在窗口执行 npm install nrm -g 即可。

 

标签:npm,rename,node,ERR,modules,Program,报错,Files
From: https://www.cnblogs.com/TpLife/p/17470801.html

相关文章

  • 构建编译dockerfile docker build报错make: uname: Operation not permitted
    报错信息:查看docker版本#docker-vDockerversion1.13.1,build7d71120/1.13.1在dockerfile中我使用的基础镜像为FROMalpine:3.16.5解决办法是升级docker或者降低Alpine的版本,我这边选择升级docker版本卸载现有docker版本#yum-yremove$(rpm-qa|grepdocker......
  • Exadata存储节点image升级,patch_check_prereq阶段报错
    1、某客户有一台ExadataX4-2,当前的image版本为11.2.3.3.1,计划将image版本升级到18.1.34.0.0。当针对存储节点执行升级前的预升级检查工作时报错。具体如下所示:[root@dm01dbadm01patch_18.1.34.0.0.210717]#./patchmgr-cellscell_group-patch_check_prereq-rolling ......
  • 【docker】docker build 报错
    报错信息dockerbuild的时候,报错了:[+]Building0.2s(3/3)FINISHED=>[internal]lo......
  • 配置SQLDeveloper连接mysql时报错Message from server:”host ‘****’ is not allowe
    问题描述:配置SQLDeveloper连接mysql时报错Messagefromserver:”host‘****’isnotallowedtoconnecttothismysqlserver”,如下所示:数据库:mysql8.0.27SQLDeveloper版本:23.1.0.097连接mysql使用的驱动文件:mysql-connector-j-8.0.33.jar1、异常重现2、解决过程[root......
  • EasyRTMPLive拉转推硬件设备访问端口返回404报错,该如何解决?
    TSINGSEE青犀视频的各个平台部署灵活,视频能力丰富且全面、能满足用户的多场景视频监控需求。平台各具特点,可支持多类型的设备、多协议接入,包括国标GB28181协议、RTMP/RTSP/Onvif协议、海康EHOME、海康SDK、大华SDK等,在视频流分发上,能支持全终端、全平台的视频流输出,包括RTSP、RTMP......
  • taro使用taro3-echarts-react报错,图表不出来
    问题taro版本3.6.2taro3-echarts-react版本1.0.4在taro小程序开发中,使用taro3-echarts-react时,echarts版本需要选择4.9.0,但是我们往往需要使用高版本的echarts,但是引入echarts.js文件后,控制台报错:el.addEventListenerisnotafunction或者t.addEventListenerisnotaf......
  • yum源使用报错-RockyLInux8.7-Modular dependency problem:
    报错信息如下:Kubernetes11kB/s|173kB00:15Modulardependencyproblem:Problem:conflic......
  • 【已解决】可视化报错keyError
    bug:inget_locraiseKeyError(key)fromerrKeyError:'2021'原因除了对应的表格的列真的没有这个数据之外。还有一种情况是像我一样。gdp_top10,我这里只是存储了CountryName,我却想在后边拿到gdp_top10['2021'],2021忘记存进去了,所以后面就显示找不到咯。解决:使用merg......
  • 遇到chrome_options.add_experimental_option ("debuggerAddress", port_number)调起
    1、查看谷歌版本和chromedriver版本是否一致:手动查找ChromeDriver路径。在终端中输入以下命令:whichchromedriver这将输出ChromeDriver的路径,例如:/usr/local/bin/chromedriver可以在Chrome浏览器中输入以下网址来查看版本信息: chrome://version/在命令行中,你可以......
  • 【HMS Core】华为帐号服务,获取Access Token报错{sub_error:20152,error_description:inv
    ​ 【问题描述】华为账号服务,接口获取AccessToken报错:{sub_error:20152,error_description:invalidcode,error:1101} 【问题分析】根据官网提示,是code格式不正确造成的,需要检查参数配置​ 【解决方案】1、此问题解决方案,可以参考这篇帖子https://developer.huawei.com/......