在安装呦权限被拒绝 [英] Permission denied while installing Yo
问题描述
我试图建立哟使用角度发生器的项目。我下面在这里相关详细步骤: http://yeoman.io/learning/index.html
I'm trying to set up yo to use the angular generator for a project. I am following the steps detailled here: http://yeoman.io/learning/index.html
我已经安装的Node.js和NPM。
I already have Node.js and NPM installed.
但是,当我使用命令:
sudo npm install -g yo bower grunt-cli
它失败,我得到这个错误:
It fails and I get this error:
> spawn-sync@1.0.11 postinstall /usr/lib/node_modules/yo/node_modules/cross-spawn/node_modules/spawn-sync
> node postinstall
fs.js:439
return binding.open(pathModule._makeLong(path), stringToFlags(flags), mode);
^
Error: EACCES, permission denied '/usr/lib/node_modules/yo/node_modules/cross-spawn/node_modules/spawn-sync/package.json'
at Object.fs.openSync (fs.js:439:18)
at Object.fs.writeFileSync (fs.js:978:15)
at Object.<anonymous> (/usr/lib/node_modules/yo/node_modules/cross-spawn/node_modules/spawn-sync/postinstall.js:20:6)
at Module._compile (module.js:456:26)
at Object.Module._extensions..js (module.js:474:10)
at Module.load (module.js:356:32)
at Function.Module._load (module.js:312:12)
at Function.Module.runMain (module.js:497:10)
at startup (node.js:119:16)
at node.js:935:3
npm ERR! Linux 3.13.0-24-generic
npm ERR! argv "node" "/usr/bin/npm" "install" "-g" "yo"
npm ERR! node v0.10.37
npm ERR! npm v2.11.0
npm ERR! code ELIFECYCLE
npm ERR! spawn-sync@1.0.11 postinstall: `node postinstall`
npm ERR! Exit status 8
npm ERR!
npm ERR! Failed at the spawn-sync@1.0.11 postinstall script 'node postinstall'.
npm ERR! This is most likely a problem with the spawn-sync package,
npm ERR! not with npm itself.
npm ERR! Tell the author that this fails on your system:
npm ERR! node postinstall
npm ERR! You can get their info via:
npm ERR! npm owner ls spawn-sync
npm ERR! There is likely additional logging output above.
npm ERR! Please include the following file with any support request:
npm ERR! /home/vincent/npm-debug.log
我试图用搭配chmod 777 / usr / lib目录/ node_modules
,但它似乎没有更好的工作。
I tried to use chmod 777 on /usr/lib/node_modules
but it doesn't seem to work better.
我可以安装鲍尔和咕噜,它的工作,但是当我尝试安装呦,它失败每次...
I can install Bower and Grunt, it worked, but when I try to install Yo, it fails everytime...
我不知道该怎么做的一切,我尝试使用搭配chmod
或 CHOWN
没有工作。
I have no idea what to do as everything I tried using chmod
or chown
didn't work.
感谢您的帮助家伙! :)
Thanks for your help guys! :)
推荐答案
我工作围绕这一问题,通过使用:
I worked around the issue by using:
sudo的NPM安装-g哟--unsafe烫发
用途 - 不安全的烫发
通过nyakto在这的 bug报告。
Use of --unsafe-perm
suggested by nyakto in this bug report.
编辑 - 意识到,这是由@Stephan在他的回答发布网址。
Edit - realised that this is the URL posted by @Stephan in his answer.
我不知道--unsafe烫发的细节 - 我只能说明它让我安装哟没有错误我经历了非常相似/相同的OP
I don't know the specifics about --unsafe-perm - I can only state that it allowed me to install yo without errors I experienced that were very similar / identical to OP.
这篇关于在安装呦权限被拒绝的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!