安装 npm 包失败 "npm ERR!错误号 -4048" [英] Fail to install npm package "npm ERR! errno -4048"

查看:42
本文介绍了安装 npm 包失败 "npm ERR!错误号 -4048"的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在尝试安装 npm 包 (node-xmpp-server),但安装失败.以前当我尝试安装全局而不是本地安装的软件包时,但现在根本没有安装.
请帮帮我.

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 install node-xmpp-server
错误是:npm ERR!错误号 -4048
npm 错误!Windows_NT 6.3.9600
npm 错误!argv "c:Program Files odejs ode.exe" "c:Program
文件 odejs ode_modules pmin pm-cli.js" "安装" "node-xmpp-server"

npm 错误!节点 v0.12.4
npm 错误!npm v2.10.1
npm 错误!路径 c:UsersJaseem AbbasDocuments ode_modules ode-xmpp-serverexamples
npm 错误!代码 EPERM
npm 错误!错误号 -4048
npm 错误!错误:EPERM,取消链接 'c:UsersJaseem AbbasDocuments ode_modules ode-xmpp-serverexamples'

npm 错误!在错误(本机)
npm 错误!{ [错误:EPERM,取消链接'c:UsersJaseem AbbasDocuments ode_modules ode-xmpp-serverexamples']

npm 错误!错误号:-4048,
npm 错误!代码:'EPERM',
npm 错误!路径:'c:UsersJaseem AbbasDocuments ode_modules ode-xmpp-serverexamples' } npm ERR!
npm 错误!请尝试以 root/管理员身份再次运行此命令.
npm 错误!错误回滚错误:EPERM,取消链接'c:UsersJaseem AbbasDocuments ode_modules ode-xmpp-serverexamples'

npm 错误!错误回滚错误(本机)
npm 错误!错误回滚 { [错误:EPERM,取消链接 'c:UsersJaseem
AbbasDocuments ode_modules ode-xmpp-serverexamples']
npm 错误!错误回滚 errno: -4048,
npm 错误!错误回滚代码:'EPERM',
npm 错误!错误回滚路径:'c:UsersJaseem AbbasDocuments ode_modules ode-xmpp-serverexamples' }

npm install node-xmpp-server
error is: npm ERR! errno -4048
npm ERR! Windows_NT 6.3.9600
npm ERR! argv "c:Program Files odejs ode.exe" "c:Program
Files odejs ode_modules pmin pm-cli.js" "install" "node-xmpp-server"

npm ERR! node v0.12.4
npm ERR! npm v2.10.1
npm ERR! path c:UsersJaseem AbbasDocuments ode_modules ode- xmpp-serverexamples
npm ERR! code EPERM
npm ERR! errno -4048
npm ERR! Error: EPERM, unlink 'c:UsersJaseem AbbasDocuments ode_modules ode-xmpp-serverexamples'

npm ERR! at Error (native)
npm ERR! { [Error: EPERM, unlink 'c:UsersJaseem AbbasDocuments ode_modules ode-xmpp-serverexamples']

npm ERR! errno: -4048,
npm ERR! code: 'EPERM',
npm ERR! path: 'c:UsersJaseem AbbasDocuments ode_modules ode-xmpp-serverexamples' } npm ERR!
npm ERR! Please try running this command again as root/Administrator.
npm ERR! error rolling back Error: EPERM, unlink 'c:UsersJaseem AbbasDocuments ode_modules ode-xmpp-serverexamples'

npm ERR! error rolling back at Error (native)
npm ERR! error rolling back { [Error: EPERM, unlink 'c:UsersJaseem
AbbasDocuments ode_modules ode-xmpp-serverexamples']
npm ERR! error rolling back errno: -4048,
npm ERR! error rolling back code: 'EPERM',
npm ERR! error rolling back path: 'c:UsersJaseem AbbasDocuments ode_modules ode-xmpp-serverexamples' }

推荐答案

杀死任何正在锁定文件的进程

这种错误似乎是由文件权限锁定引起的 - 我在安装 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!错误号 -4048"的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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