nodejs
1. install npm packages globally without sudo
- Create a directory for globally packages
mkdir "${HOME}/.npm-packages" - Indicate to
npmwhere to store globally installed packages. In your~/.npmrcfile add:# ~/.npmrc prefix=${HOME}/.npm-packages - Ensure
npmwill find installed binaries and man pages. Add the following to your.bashrcor.zshrc:NPM_PACKAGES="${HOME}/.npm-packages" PATH="$NPM_PACKAGES/bin:$PATH" # Unset manpath so we can inherit from /etc/manpath via the `manpath` command unset MANPATH # delete if you already modified MANPATH elsewhere in your config export MANPATH="$NPM_PACKAGES/share/man:$(manpath)"
reference is here