无法运行"npm install"升级到NPM 5.4.1后无需删除node_modules [英] Can't run "npm install" without deleting node_modules after upgrading to NPM 5.4.1

查看:319
本文介绍了无法运行"npm install"升级到NPM 5.4.1后无需删除node_modules的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我已经将NPM从5.3.0升级到5.4.1,此后,似乎只有在删除 node_modules 后,命令 npm install 才有效.当我尝试重新运行安装时,出现以下错误消息. (此后,如果我再次删除 node_modules ,则命令 run install 有效-一次.)

I've upgraded NPM from 5.3.0 to 5.4.1 and after that, it seems that the command npm install works only if I've removed node_modules. When I try to rerun the installation, I'm getting the following error message. (After that, if I again remove node_modules, the command run install works - once.)

PS C:\ source \ website> npm install
npm ERR!路径C:\ source \ website \ node_modules \ fsevents \ node_modules \ aproba \ package.jsonvet.Web
npm ERR!代码EPERM
npm ERR! errno -4048
npm ERR! syscall取消链接
npm ERR!错误:EPERM:不允许进行操作,请取消链接'C:\ source \ website \ node_modules \ fsevents \ node_modules \ aproba \ package.json'
npm ERR! {
错误:EPERM:不允许进行操作,请取消链接'C:\ source \ website \ node_modules \ fsevents \ node_modules \ aproba \ package.json'
npm ERR!堆栈:'错误:EPERM:不允许操作,取消链接\'C:\ source \ website \ node_modules \ fsevents \ node_modules \ aproba \ package.json \'',
npm ERR! errno:-4048,
npm ERR!代码:"EPERM",
npm ERR! syscall:'unlink',
npm ERR!路径:
'C:\ source \ website \ node_modules \ fsevents \ node_modules \ aproba \ package.json'} npm错误!
npm ERR!请尝试以root/管理员身份再次运行此命令.
npm ERR!可以在以下位置找到此运行的完整日志:
npm ERR! C:\ Users \ butt \ AppData \ Roaming \ npm-cache_logs \ 2017-09-13T16_42_26_030Z-debug.log
PS C:\ source \ website>

PS C:\source\website> npm install
npm ERR! path C:\source\website\node_modules\fsevents\node_modules\aproba\package.jsonvet.Web
npm ERR! code EPERM
npm ERR! errno -4048
npm ERR! syscall unlink
npm ERR! Error: EPERM: operation not permitted, unlink 'C:\source\website\node_modules\fsevents\node_modules\aproba\package.json'
npm ERR! {
Error: EPERM: operation not permitted, unlink 'C:\source\website\node_modules\fsevents\node_modules\aproba\package.json'
npm ERR! stack: 'Error: EPERM: operation not permitted, unlink \'C:\source\website\node_modules\fsevents\node_modules\aproba\package.json\'',
npm ERR! errno: -4048,
npm ERR! code: 'EPERM',
npm ERR! syscall: 'unlink',
npm ERR! path:
'C:\source\website\node_modules\fsevents\node_modules\aproba\package.json' } npm ERR!
npm ERR! Please try running this command again as root/Administrator.
npm ERR! A complete log of this run can be found in:
npm ERR! C:\Users\butt\AppData\Roaming\npm-cache_logs\2017-09-13T16_42_26_030Z-debug.log
PS C:\source\website>

据我所知,我的设置没有其他改变.我的环境是Windows 10和Node 8.2.1.该行为似乎在多台计算机上是一致的.

Nothing else has changed in my setup, as far I'm aware. My environment is Windows 10 and Node 8.2.1. The behavior seems to be consistent on several computers.

我注意到在重新运行安装过程中,接下来的阶段会有很多等待时间,例如安装程序是否卡住.

I notice that during the re-runs of the installation, there's a lot of waiting time, like if the installer gets stuck, on the following stage of it.

在29.671秒内添加了995个包
PS C:\ source \ website> npm install
[......]-后安装:sill doSerial后安装686

added 995 packages in 29.671s
PS C:\source\website> npm install
[ ......] - postinstall: sill doSerial postinstall 686

我不知道如何进行此操作.难道是 fsevents 的罪魁祸首吗?我记得它产生了警告,但在早期版本中仍然可以很好地编译.

I have no clue on how to proceed with this. Is fsevents to blame at all? I recall that it produced warnings but still transpiling fine in earlier versions.

关于这个主题,有一个相关问题涵盖我的问题.我无法确定是解决同一问题的不同方式,还是两个单独的麻烦.

There's a related question on this theme but precisely covering my issue. I can't decide if it's just different working of the same problem or if it's two separate troubles.

推荐答案

我正在运行Win 10,并且发现了相同的问题.该决议是降级到5.3.我还注意到5.4.0在我们的构建服务器(TFS 2017)上工作.

I'm running Win 10 and recognized the same issue. The resolution was to downgrade to 5.3. I also noticed that 5.4.0 worked on our build server (TFS 2017).

npm install --global npm@5.3.0

关于管理模式的所有内容根本没有提供任何帮助.我们浪费了几个小时使用管理员权限重新配置和重置构建管道.

One thing that provided no help at all was all the stuff about admin mode. We lost a few hours reconfiguring and resetting the build pipe using admin rights.

出于某些原因,有一个至关重要的模块需要5.4.1,而在此特定情况下与该模块无关.我们通过管道中的单独步骤解决了该问题-一个步骤重复使用了预先构建的版本,而另一个步骤则是动态组装的.

There was a crucial module that required 5.4.1 for some reason, not relevant which in this particular case. We resolved it by separate steps in the pipe - one that reused a pre-built version and one that was dynamically assembled.

我也不必为此担心.在几天左右的时间内,必须进行更新,此问题将得到解决.在此之前-我们使用的破解方法是降级到5.3.

Also, I'd not worry about it. In a few days or so, there's got to be an update and the issue will be resolved. Until then - downgrade to 5.3 is the hack-around we used.

这篇关于无法运行"npm install"升级到NPM 5.4.1后无需删除node_modules的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆