使用Yeoman EACCES错误安装angular度

我试过跑步

yo angular --coffee --minsafe 

但我得到这个错误

  Error: EACCES, permission denied '/Users/Basil/.config/configstore/insight-yo.yml' at Object.fs.openSync (fs.js:427:18) at Object.fs.writeFileSync (fs.js:966:15) at Object.create.all.set (/usr/local/lib/node_modules/yo/node_modules/insight/node_modules/configstore/configstore.js:39:7) at Object.Configstore (/usr/local/lib/node_modules/yo/node_modules/insight/node_modules/configstore/configstore.js:30:11) at new Insight (/usr/local/lib/node_modules/yo/node_modules/insight/lib/insight.js:20:16) at Object.<anonymous> (/usr/local/lib/node_modules/yo/bin/yo:26:15) 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) 

我已经检查了Github上的问题,看到npm / yeoman安装generator-angular没有sudo,但似乎无法得到它的工作

节点v0.10.17 npm v1.2.10

 find / -name 'yeoman' 

/Users/Basil/.node/node_modules/.bin/yeoman /Users/Basil/.node/node_modules/yeoman /Users/Basil/.node/node_modules/yeoman/bin/yeoman /Users/Basil/.node/node_modules/ yeoman / node_modules / yeoman-generators / lib / generators / yeoman /Users/Basil/.npm/yeoman /Users/Basil/.npm/yeoman/0.9.6/package/bin/yeoman /Users/Basil/.npm/yeoman -generators / 0.9.5 /包/ LIB /发电机/自耕农

我能够解决这个问题:

 Sudo chown Basil /Users/Basil/.config/configstore/update-notifier-yo.yml 

如果遇到此问题,请尝试使用您的用户名replace“Basil”

你可以使用npm cache cleanbower cache clean

Sudo chown Basil /Users/Basil/.config/configstore/update-notifier-yo.yml (删除结尾的chown)用您的用户名replaceBasil。

Sudo chown <yourusername> /Users/<yourusername>/.config/configstore/update-notifier-yo.yml记住您的用户名不包含美元符号。

运行Yeoman时纠正了错误:

 EACCES, permission denied '/Users/<yourusername>/.config/configstore/update-notifier-yo.yml' 

如果上述不起作用,只需删除/Users/USER_NAME/.config/configstore/目录中的所有文件,然后再次运行yoangular度。 用您的用户名replaceUSER_NAME。

我只是在Windows中修复它。 我已经做了三件事,哪一件已经解决了,我不确定。

  1. 以pipe理员身份运行cmd提示符。

  2. takeown /? 这个命令相当于chown(linux),但是对于windows。

  3. cacls -cacls / E / T / G:F

  4. 只需进入$ USER /Users/calvin/.config/configstore/并使文件不被隐藏。

它为我工作像魅力。 多年来我一直在努力解决这个问题。

这可能来不及回答,但为了帮助其他人,更改权限(chmod)和所有者(chown)是Ubuntu上的工作:

 sudo chmod g+rwx /home/myusername/.config/configstore sudo chown myusername /home/myusername/.config/configstore 

这个为我工作:

 //Update npm to the latest version. Works for to upgrade 1.x to 2.x. $ npm install -g npm stable // Assign group permissions to the parent directory. $ chmod g+rwx /root /root/.config /root/.config/configstore