2017-09-03 83 views
7

的Windows 10 1703
节点6.11.2
NPM 5.4.0NPM - 错误:EPERM:操作不允许,断开链接

每次我尝试安装NPM包(例如:NPM我吞掉通知),我收到以下错误:


npm ERR!路径C:\ Users \ web-dev \ Desktop \ barber \ node_modules \ fsevents \ node_modules \ ansi-regex \ package.json
npm ERR!代码EPERM
npm ERR! errno -4048
npm ERR! syscall unlink
npm ERR! Error:EPERM:operation not permitted,unlink'C:\ Users \ web-
dev \ Desktop \ barber \ node_modules \ fsevents \ node_modules \ ansi-regex \ package.json' npm ERR! at error(native)
npm ERR! {Error:EPERM:operation not permitted,unlink'C:\ Users \ web-dev \ Desktop \ barber \ node_modules \ fsevents \ node_modules \ ansi-regex \ package.json'
npm ERR! at error(native)
npm ERR!错误(本地)“错误:EPERM:操作不允许,取消链接\'C:\ Users \ web-dev \ Desktop \ barber \ node_modules \ fsevents \ node_modules \ ansi-regex \ package.json \'\ n ,
npm ERR! errno:-4048,
npm ERR!代码:'EPERM',
npm ERR! syscall:'unlink',
npm ERR!路径:'C:\ Users \ web-dev \ Desktop \ barber \ node_modules \ fsevents \ node_modules \ ansi-regex \ package.json'}
npm ERR! npm ERR!请尝试以root/Administrator身份再次运行此命令。


我跑在cmd以管理员身份
我检查文件夹权限
我清除缓存,即使故宫说,它做它本身
我改变NPM前缀C:\用户\用户名\ AppData \ Roaming \ npm
没有帮助。

请指教。

+0

我想有些进程通过访问它们来锁定你的文件(可能是你的代码编辑器?)。如果可能,请在您的操作系统上禁用文件锁定 – ideaboxer

+0

我通过向安装命令添加了-g标志来解决了这个问题。请关闭该问题。 –

+1

我降级到npm 5.3.0,一切都很顺利。尝试了所有通常的补救措施,我认为npm中的某些东西会将自己锁定。 – Gary

回答

1

显然我试图在本地安装软件包而不是全局没有-g标志。对于那个很抱歉。现在所有人都在工作。

相关问题