手机
当前位置:查字典教程网 >编程开发 >Javascript教程 >Windows环境下npm install 报错: operation not permitted, rename的解决方法
Windows环境下npm install 报错: operation not permitted, rename的解决方法
摘要:前言最近发现了一个问题,运行npminstall命令安装依赖包,在Mac上的Vagrant装的虚拟机上没问题,在阿里云CentOS上也没问题...

前言

最近发现了一个问题,运行 npm install 命令安装依赖包,在 Mac 上的 Vagrant 装的虚拟机上没问题,在阿里云 CentOS 上也没问题,但是在 Windows 环境同样是 Vagrant 装的环境相同的虚拟机上就是不成功,报错如下:

npm ERR! Error: EPERM: operation not permitted, rename ‘/usr/share/nginx/html/tanteng.me/node_modules/duplexify' -> ‘/usr/share/nginx/html/tanteng.me/node_modules/.duplexify.DELETE'

Windows环境下npm install 报错: operation not permitted, rename的解决方法1

之前遇到过 Windows 上 npm 安装依赖出现 symbol 的错误,解决方法是 sudo npm install –no-bin-links,加后面的参数即可。

列出 Node.js 的安装目录,目录的权限属性如图:

Windows环境下npm install 报错: operation not permitted, rename的解决方法2

这里执行命令:

sudo chown vagrant:vagrant n node npm

记住还要清除 npm 缓存:

npm cache clean

再次执行 sudo npm install –no-bin-links,Windows 环境下即使是在虚拟机也需要带上后面的参数。

好了,这个时候问题就解决。以上就是这篇文章的全部内容了,希望本文能对同样遇到这个问题朋友们有所帮助。

【Windows环境下npm install 报错: operation not permitted, rename的解决方法】相关文章:

破解Session cookie的方法

JavaScript中Math.SQRT2属性的使用详解

JavaScript中String.prototype用法

javascript操作ul中li的方法

深入浅出理解javaScript原型链

实现高性能JavaScript之执行与加载

jQuery获取页面元素绝对与相对位置的方法

收集整理的四个方向的滚动

原生js实现的贪吃蛇网页版游戏完整实例

点此处秒后立即下载

精品推荐
分类导航