NPM报错 Error: EPERM: operation not permitted, unlink......解决办法。使用 rimraf 快速删除node_modules和清除缓存
由于国内外环境因素,npm install安装依赖的时候经常会出现各种问题,特别是“Error: EPERM: operation not permitted, unlink…”这个错误。
其实这个错误出现的原因就是网络不稳定,导致npm包下载不完整或者出错导致的。什么,你家里100M光纤网速飞起?但服务器是国外的,该慢的时候还是得慢。
而一次出错之后,一般人都会再次npm install ,而npm install命令并不会主动清除上次安装的包,而你上次安装的包又不完整,包与包之间又有依赖关系,结果自然就会出错。
所以,要想解决这个问题,就应该清除上次安装的包,想要彻底清除则一般需要以下2步:
一.删除node modules中的全部文件。
【删除node modules文件】的方式有两种:
1、直接右键删除,缺点是依赖过多时,删除速度非常慢。
2、通过安装rimraf来删除(推荐此种方法,光速)。
安装(推荐全局安装):
npm install -g rimraf
使用:rimraf node_modules
二.清除Npm缓存。
【清除Npm缓存】的方式有两种:
第一种是直接删除缓存文件,删除C:\Users\用户名.npmrc 这个文件。
第二种是执行:npm cache clean --force,同样达到清除缓存文件的目的。
三.以上不能解决的话(可以使用以下方法)
解决办法1:
权限问题,使用管理员权限的cmd可解决问题。
解决办法2:
缓存问题,清除C:\Users\用户名.npmrc文件即可。
NPM报错 Error: EPERM: operation not permitted, unlink......解决办法。使用 rimraf 快速删除node_modules和清除缓存相关推荐
- npm安装报错Error: EPERM: operation not permitted解决方案
电脑重装系统后重新配置环境安装node后,npm命令安装报错 Error: EPERM: operation not permitted npm ERR! code EPERM npm ERR! sy ...
- 【解决方法】hexo g 报错 OperationalError: EPERM: operation not permitted, unlink ...
运行 hexo g 报错如下: FATAL {err: [OperationalError: EPERM: operation not permitted, unlink 'F:\blog\publi ...
- node.js报错“Error: EPERM: operation not permitted, stat ‘C:\Recovery‘“
异常 node:internal/fs/utils:344throw err;^Error: EPERM: operation not permitted, stat 'C:\Recovery'at ...
- npm intasll 安装报错 Error: EPERM: operation not permitted, mkdir ‘C:\Program Files\nodejs\node_cache\_
Node.js安装及环境配置完成之后 npm install express -g 安装全局的模块报错提示没有权限operation not permitted mkdir 错误编号4048: 其原因 ...
- npm install 报错(npm ERR! errno -4048,Error: EPERM: operation not permitted,)解决方法
npm install 报错(npm ERR! errno -4048,Error: EPERM: operation not permitted,)解决方法 参考文章: (1)npm install ...
- npm install 提示权限不足 Error: EPERM: operation not permitted, unlink XXX
问题描述 使用npm install出现 npm install 提示权限不足 Error: EPERM: operation not permitted, unlink XXX提示 原因 这里原因有 ...
- Error: EPERM: operation not permitted, unlink 'D:\Sources\**\node_modules\fsevents\node_modules\abbr
原因 编辑器或IDE打开了vue项目,我的是idea打开了 vue 解决办法 关闭IDE或编辑器,删除node_modules文件目录,然后重新执行npm install命令 注意windows系统需 ...
- 部署hexo遇到报错ERROR Deployer not found: git的解决办法
部署hexo遇到报错ERROR Deployer not found: git的解决办法 今天部署hexo的时候遇到一个报错 hexo c && hexo g && h ...
- npm install报错:EPERM: operation not permitted
部分内容转载于:"npm ERR! Error: EPERM: operation not permitted"权限不足问题解决 - 代码先锋网 今天又遇到了EPERM: oper ...
最新文章
- spring计算方圆300km内其它城市(附完整代码)
- Java中常见的5种WEB服务器介绍
- 专家观点:不断茁壮的音频生态系统中心(转)
- 使用最大似然法来求解线性模型(1)
- MYSQL数据库索引设计的原则
- ppt图片丢失_041 职场PPT实战:做好的PPT换个电脑就丢字体?三招解决!
- node.js Error: connect EMFILE 或者 getaddrinfo ENOTFOUND
- CANOpen生命守护机制
- python-----学习资料
- [转载] 推荐的C++书籍以及阅读顺序
- 计算机视觉(CV)中HOG算法的主要步骤
- win11WiFi无法连接网络怎么办 Windows11WiFi无法连接网络的解决方法
- 大事化小、小事化了的动态规划
- xamarin android界面框架,Xamarin图表开发基础教程(3)OxyPlot框架
- 品牌设计分析思维导图模板分享
- HTML5期末大作业:网站设计——天天生鲜水果蔬菜商城网站静态模板 (10个页面) HTML+CSS+JavaScript...
- 如何通过TXT文件批量生成DataMatrix码
- 你知道啥是无监督聚类吗?
- 苹果手机聊天记录恢复方法有哪些?这2个恢复技巧值得收藏
- html字体库otf文件使用,在webpack中加载.otf字体文件的正确方法是什么?