npm npm-global-install.sh
:
#!/usr/bin/env bash
cat packages.txt | xargs npm install --global
yarn yarn-global-add.sh
:
#!/usr/bin/env bash
cat packages.txt | xargs yarn global add
~/.bashrc
or ~/.zshrc
:
# npm
# export PATH="$(npm bin --global):$PATH"
export PATH="$PATH:$HOME/.npm-global/bin"
# yarn
# export PATH="$(yarn global bin):$PATH"
export PATH="$PATH:$HOME/.yarn-global/bin"
Run source ~/.bashrc
or source ~/.zshrc
.
~/.npmrc
:
prefix=/home/illvart/.npm-global
cache=/home/illvart/.npm-global/cache
~/.yarnrc
:
prefix "/home/illvart/.yarn-global"
cache-folder "/home/illvart/.yarn-global/cache"
global-folder "/home/illvart/.yarn-global"