1

我正在尝试在需要“ref”的项目上执行 npm install,但出现此错误。知道如何纠正这个吗?

我有 nvm 正在运行并且 node -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
4

2 回答 2

1

这表明您没有创建目录的权限。

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

于 2014-03-08T10:30:12.220 回答
0

与您正在运行命令的用户一起尝试 mkdir '/root/node-ffi-libvirt/nodejs-usage/ffi-libvirt/node_modules/ref/build' 。首先修复它,然后运行您的命令。

于 2014-03-08T11:36:29.530 回答