Skip to content

Instantly share code, notes, and snippets.

@lopezjurip
Created Dec 16, 2016
Embed
What would you like to do?
macOS: Yarn + nvm with globals (bins) to $PATH

Yarn and nvm

  • Requisites: brew

Install nvm:

brew install nvm

Add this to your ~/.bashrc or ~/.zshrc:

export NVM_DIR="$HOME/.nvm"
. "/usr/local/opt/nvm/nvm.sh"

Install the Node.js versions you need:

nvm install node

Install yarn with npm:

npm install -g npm # self-update npm
npm install -g yarn

Add yarn installed bins to $PATH (on ~/.bashrc or ~/.zshrc):

export PATH="$HOME/.config/yarn/global/node_modules/.bin:$PATH"

Install and use globals:

yarn global add eslint serverless create-react-app

# Use
create-react-app hello-world
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment