gpt4 book ai didi

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

转载 作者:太空宇宙 更新时间:2023-11-04 01:06:39 24 4
gpt4 key购买 nike

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

我有 nvm 正在运行并且 Node -v = 0.10.26

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

node-gyp rebuild

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 身份运行安装。

关于javascript - nodejs npm安装错误,如何纠正?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/22268063/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com