




























Several ways to fix the problem of running node tools and npm without sudo (which probably always results in an error).
Creating npm local in your home directory. Changing the npm configuration and pointing to this directory.
npm config set prefix ~/npm
Adding the directory to my path. Adding this line to .zshrc or .bashrc
export PATH="$PATH:$HOME/npm/bin"
Giving the path to all the node directories to the current user:
sudo chown -R `whoami` ~/.npm
sudo chown -R `whoami` /usr/local/lib/node_modules
此内容由惯性聚合(RSS阅读器)自动聚合整理,仅供阅读参考。 原文来自 — 版权归原作者所有。