安装yeoman报没有权限的错误

新的ubuntu服务器, 不小心先装了npm, 再装的node, 再用meanjs装的yeoman(即不是自己npm install -g yo装的, 是用meanjs的stack一步到位的),而正常顺序应该是node, npm , yeoman

之所以讲这个前提,是因为我不知道是顺序问题,还是我自己服务器的配置问题, 总之, 上面的步骤进行完后, 我用yo命令, 得到如下错误:

Error: EACCES, permission denied '/root/.config/configstore/insight-yo.yml'

实际上不是无权限的问题,因为configstore这个文件夹都不存在, 重新手动安装了一次yeoman, 仍然报此错误, 那么应该不是没装好的问题, 在这篇贴子(https://github.com/yeoman/yeoman.io/issues/282)的某一层楼找到一个解决办法, 分享出来:

echo prefix = ~/.node >> ~/.npmrc
export PATH=$HOME/.node/bin:$PATH
原文地址:https://www.cnblogs.com/walkerwang/p/4206222.html