Skip to content

Instantly share code, notes, and snippets.

@lopezjurip
Created December 16, 2016 21:08
Show Gist options
  • Star 3 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save lopezjurip/c9657d889f0526f55b0ad6dc48fde7c1 to your computer and use it in GitHub Desktop.
Save lopezjurip/c9657d889f0526f55b0ad6dc48fde7c1 to your computer and use it in GitHub Desktop.
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