npm 权限问题

来源:互联网 发布:网络兼职怎么找 编辑:程序博客网 时间:2024/06/06 00:54

Make a directory for global installations:
mkdir ~/.npm-global

Configure npm to use the new directory path:
npm config set prefix ‘~/.npm-global’

Open or create a ~/.profile file and add this line:
export PATH=~/.npm-global/bin:$PATH

Back on the command line, update your system variables:
source ~/.profile

Test: Download a package globally without using sudo.

npm install -g *

原创粉丝点击