使用 npm 安装 yeoman 的权限 - eaccess? [英] permissions installing yeoman with npm - eaccess?
问题描述
我用自制软件安装了 npm 并且必须链接它 - 我想这可能是问题的一部分.这对我来说是全新的,所以我正在寻求任何帮助.我正在尝试在计算机上安装 yeoman 和其他一些东西
I installed npm with homebrew and had to link it - i'm thinking this may be some part of the issue. This is all new to me so I am seeking any help. I am trying to install yeoman and some other things on a computer with
npm install -g yo
然而,它正在回吐错误 -
however it is spitting back the error -
npm ERR! Darwin 14.0.0
npm ERR! argv "node" "/usr/local/bin/npm" "install" "-g" "yo"
npm ERR! node v0.12.0
npm ERR! npm v2.5.1
npm ERR! path /Users/Lynda/npm-global/lib/node_modules/yo/lib
npm ERR! code EACCES
npm ERR! errno -13
npm ERR! Error: EACCES, unlink '/Users/Lynda/npm-global/lib/node_modules/yo/lib'
npm ERR! at Error (native)
npm ERR! { [Error: EACCES, unlink '/Users/Lynda/npm-global/lib/node_modules/yo/lib']
npm ERR! errno: -13,
npm ERR! code: 'EACCES',
npm ERR! path: '/Users/Lynda/npm-global/lib/node_modules/yo/lib' }
npm ERR!
npm ERR! Please try running this command again as root/Administrator.
npm ERR! error rolling back Error: EACCES, unlink '/Users/Lynda/npm-global/lib/node_modules/yo/lib'
npm ERR! error rolling back at Error (native)
npm ERR! error rolling back { [Error: EACCES, unlink '/Users/Lynda/npm-global/lib/node_modules/yo/lib']
npm ERR! error rolling back errno: -13,
npm ERR! error rolling back code: 'EACCES',
npm ERR! error rolling back path: '/Users/Lynda/npm-global/lib/node_modules/yo/lib' }
我做了一堆谷歌搜索,找不到任何东西,可以使用一些帮助!如果可以,我想避免 sudo'ing.谢谢.
I did a bunch of googling and can't find anything, could use some help! I'd like to avoid sudo'ing if I can. Thanks.
推荐答案
我喜欢的 node & 安装方式OSX 上的 npm:
My preferred way of installing node & npm on OSX:
通过 homebrew 安装节点,无需 npm
:
Install node via homebrew without npm
:
brew update
brew install node --without-npm
echo prefix=~/.node >> ~/.npmrc
然后通过 npmjs.org 上的安装脚本安装 npm
:
Then install npm
via the install script on npmjs.org:
如果你狂野而疯狂:
curl -L https://www.npmjs.org/install.sh | sh
否则,下载https://www.npmjs.org/install.sh,检查使您满意,chmod +x 并执行它.
Otherwise, download https://www.npmjs.org/install.sh, inspect to your satisfaction, chmod +x and execute it.
然后将 $HOME/.node/bin
添加到您的路径中.
Then add $HOME/.node/bin
to your path.
注意:如果您之前已经通过图形安装程序或自制软件安装了 node + npm,您需要在再次安装之前删除之前的安装.例如,如果您通过图形安装程序安装:
Note: If you've previuously installed node + npm via the graphical installer or homebrew, you'll want to remove the previous install before installing again. For instance, if you installed via the graphical installer:
rm -rf /usr/local/lib/node_modules
rm -rf /usr/local/include/node
rm -rf ~/.npm
mv ~/.npmrc ~/.npmrc-old
这篇关于使用 npm 安装 yeoman 的权限 - eaccess?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!