npm Missing write access to /usr
作者:
Alex0825 | 来源:发表于
2020-03-15 15:20 被阅读0次# 第一步:在你的用户文件下新建一个文件夹,这个.npm-global 名字可以用你自己喜欢的名字替换,推荐直接使用这个名字。
mkdir ~/.npm-global
#第二步:更改node的安装连接
npm config set prefix '~/.npm-global'
#第三步:在用户的profile下增加path,为的是系统能够找到可执行文件的目录
touch ~/.bash_profile
vi ~/.bash_profile
export PATH=~/.npm-global/bin:$PATH
esc wq
#第四步:update profile。使其生效
source ~/.bash_profile
参考
npm 遇到 write access的问题怎么办
Mac下安装npm全局包提示权限不够
本文标题:npm Missing write access to /usr
本文链接:https://www.haomeiwen.com/subject/dmgdehtx.html
网友评论