我正在尝试在我的服务器上安装 yeoman,但由于某种原因,我总是收到权限被拒绝的错误。
$npm install -g yo
/root/.node/bin/yo -> /root/.node/lib/node_modules/yo/cli.js
> [email protected] postinstall /root/.node/lib/node_modules/yo
> yodoctor
sh: 1: yodoctor: Permission denied
npm ERR! [email protected] postinstall: `yodoctor`
npm ERR! Exit status 127
npm ERR!
npm ERR! Failed at the [email protected] postinstall script.
npm ERR! This is most likely a problem with the yo package,
npm ERR! not with npm itself.
npm ERR! Tell the author that this fails on your system:
npm ERR! yodoctor
npm ERR! You can get their info via:
npm ERR! npm owner ls yo
npm ERR! There is likely additional logging output above.
npm ERR! System Linux 3.13.0-37-generic
npm ERR! command "/usr/bin/node" "/usr/bin/npm" "install" "-g" "yo"
npm ERR! cwd /root
npm ERR! node -v v0.10.33
npm ERR! npm -v 1.4.28
npm ERR! code ELIFECYCLE
npm ERR! not ok code 0
我尝试重新安装 ubuntu (14.04) 但没有任何效果。
我认为Shantaru是对的,你需要用sudo来完成。
Try this
sudo npm uninstall -g yo
sudo npm cache clean
sudo npm install -g yo
几周前我遇到了类似的问题并且有效。
编辑:如果这不起作用,请先执行此操作:
npm config set unsafe-perm true
本文内容由网友自发贡献,版权归原作者所有,本站不承担相应法律责任。如您发现有涉嫌抄袭侵权的内容,请联系:hwhale#tublm.com(使用前将#替换为@)