标签:npm color ash github rect sha install des class
mkdir "${HOME}/.npm-packages"
npm
where to store globally installed packagesnpm config set prefix "${HOME}/.npm-packages"
npm
will find installed binaries and man pagesAdd the following to your .bashrc
/.zshrc
:
NPM_PACKAGES="${HOME}/.npm-packages" export PATH="$PATH:$NPM_PACKAGES/bin" # Preserve MANPATH if you already defined it somewhere in your config. # Otherwise, fall back to `manpath` so we can inherit from `/etc/manpath`. export MANPATH="${MANPATH-$(manpath)}:$NPM_PACKAGES/share/man"
Last:
source ~/.bashrc
[Tools] Install npm packages globally without sudo on macOS and Linux
标签:npm color ash github rect sha install des class
原文地址:https://www.cnblogs.com/Answer1215/p/12237014.html