繁体   English   中英

nodejs npm安装错误,如何纠正?

[英]nodejs npm install error, how to correct?

我试图在需要“ ref”的项目上进行npm安装,但出现此错误。 知道我该如何纠正吗?

我有nvm runnning和节点-v = 0.10.26

ref@0.1.3安装/ root / node-ffi-libvirt / nodejs-usage / ffi-libvirt / node_modules / ref

节点gyp重建

gyp ERR! configure error 
gyp ERR! stack Error: EACCES, mkdir '/root/node-ffi-libvirt/nodejs-usage/ffi-libvirt/node_modules/ref/build'
gyp ERR! System Linux 3.11.0-12-generic
gyp ERR! command "nodejs" "/usr/bin/node-gyp" "rebuild"
gyp ERR! cwd /root/node-ffi-libvirt/nodejs-usage/ffi-libvirt/node_modules/ref
gyp ERR! node -v v0.10.15
gyp ERR! node-gyp -v v0.10.9
gyp ERR! not ok 
npm ERR! ref@0.1.3 install: `node-gyp rebuild`
npm ERR! Exit status 1
npm ERR! 
npm ERR! Failed at the ref@0.1.3 install script.
npm ERR! This is most likely a problem with the ref package,
npm ERR! not with npm itself.
npm ERR! Tell the author that this fails on your system:
npm ERR!     node-gyp rebuild
npm ERR! You can get their info via:
npm ERR!     npm owner ls ref
npm ERR! There is likely additional logging output above.

npm ERR! System Linux 3.11.0-12-generic
npm ERR! command "node" "/root/.nvm/v0.10.26/bin/npm" "install" "ref"
npm ERR! cwd /root/node-ffi-libvirt/nodejs-usage/ffi-libvirt
npm ERR! node -v v0.10.26
npm ERR! npm -v 1.4.4

这表明您无权创建目录。

看起来原始项目是作为root安装的(由路径中的/root暗示)-因此,您也必须以root身份运行安装。

尝试使用您从中运行命令的用户的mkdir'/ root / node-ffi-libvirt / nodejs-usage / ffi-libvirt / node_modules / ref / build'。 首先解决该问题,然后运行命令。

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM