无法安装npm软件包"npm ERR! errno -4048"; [英] Fail to install npm package "npm ERR! errno -4048"
问题描述
我正在尝试安装npm软件包(node-xmpp-server),但安装失败.以前,当我尝试安装全局安装而不是本地安装的软件包时,现在根本没有安装.
Plz帮帮我.
I'm trying to install npm package (node-xmpp-server) but it fail to install. previously when I'm trying to install a package that is install globally instead of locally, but now it's not installing at all.
Plz Help me.
npm安装node-xmpp-server
错误是:npm ERR! errno -4048
npm ERR! Windows_NT 6.3.9600
npm ERR! argv"c:\ Program Files \ nodejs \ node.exe""c:\ Program
Files \ nodejs \ node_modules \ npm \ bin \ npm-cli.js"安装" node-xmpp-server"
npm ERR!节点v0.12.4
npm ERR! npm v2.10.1
npm ERR!路径c:\ Users \ Jaseem Abbas \ Documents \ node_modules \ node- xmpp-server \ examples
npm ERR!代码EPERM
npm ERR! errno -4048
npm ERR!错误:EPERM,取消链接'c:\ Users \ Jaseem Abbas \ Documents \ node_modules \ node-xmpp-server \ examples'
npm ERR!错误时(本机)
npm ERR! {[错误:EPERM,取消链接'c:\ Users \ Jaseem Abbas \ Documents \ node_modules \ node-xmpp-server \ examples']
npm ERR! errno:-4048,
npm ERR!代码:"EPERM",
npm ERR!路径:'c:\ Users \ Jaseem Abbas \ Documents \ node_modules \ node-xmpp-server \ examples'} npm ERR!
npm ERR!请尝试以root/Administrator身份再次运行此命令.
npm ERR!错误回滚错误:EPERM,取消链接'c:\ Users \ Jaseem Abbas \ Documents \ node_modules \ node-xmpp-server \ examples'
npm ERR!错误回滚到错误(本机)
npm ERR!回滚时发生错误{[错误:EPERM,取消链接'c:\ Users \ Jaseem
Abbas \ Documents \ node_modules \ node-xmpp-server \ examples']
npm ERR!错误回滚errno:-4048,
npm ERR!回滚代码"EPERM"时出错,
npm ERR!错误回滚路径:'c:\ Users \ Jaseem Abbas \ Documents \ node_modules \ node-xmpp-server \ examples'}
npm install node-xmpp-server
error is: npm ERR! errno -4048
npm ERR! Windows_NT 6.3.9600
npm ERR! argv "c:\Program Files\nodejs\node.exe" "c:\Program
Files\nodejs\node_modules\npm\bin\npm-cli.js" "install" "node-xmpp-server"
npm ERR! node v0.12.4
npm ERR! npm v2.10.1
npm ERR! path c:\Users\Jaseem Abbas\Documents\node_modules\node- xmpp-server\examples
npm ERR! code EPERM
npm ERR! errno -4048
npm ERR! Error: EPERM, unlink 'c:\Users\Jaseem Abbas\Documents\node_modules\node-xmpp-server\examples'
npm ERR! at Error (native)
npm ERR! { [Error: EPERM, unlink 'c:\Users\Jaseem Abbas\Documents\node_modules\node-xmpp-server\examples']
npm ERR! errno: -4048,
npm ERR! code: 'EPERM',
npm ERR! path: 'c:\Users\Jaseem Abbas\Documents\node_modules\node-xmpp-server\examples' } npm ERR!
npm ERR! Please try running this command again as root/Administrator.
npm ERR! error rolling back Error: EPERM, unlink 'c:\Users\Jaseem Abbas\Documents\node_modules\node-xmpp-server\examples'
npm ERR! error rolling back at Error (native)
npm ERR! error rolling back { [Error: EPERM, unlink 'c:\Users\Jaseem
Abbas\Documents\node_modules\node-xmpp-server\examples']
npm ERR! error rolling back errno: -4048,
npm ERR! error rolling back code: 'EPERM',
npm ERR! error rolling back path: 'c:\Users\Jaseem Abbas\Documents\node_modules\node-xmpp-server\examples' }
推荐答案
杀死任何锁定文件的进程
这种错误似乎是由文件权限锁定引起的-安装whatwg-fetch
时,我遇到了非常相似的错误(相同的ERRNO:-4048).
Kill whatever process is locking your files
It seems like this kind of error can be caused by a file permissions lock - I experienced something very similar (the same ERRNO: -4048) when installing whatwg-fetch
.
我发现我同时打开的Visual Studio实例正在获取不需要的所有文件.一旦我将其关闭,安装就可以正常进行.
I found that a Visual Studio instance I had open at the same time was acquiring all kinds of files which it didn't need. Once I closed that down, the install worked perfectly.
这可能是一个快速检查的可能原因,可以消除,然后再采取更严厉的措施...
This may be a quickly-checked possible cause to eliminate before moving on to more drastic measures...
这篇关于无法安装npm软件包"npm ERR! errno -4048";的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!