Skip to content

Instantly share code, notes, and snippets.

@pascaliske
Last active January 4, 2019 14:00
Show Gist options
  • Save pascaliske/57238467496bd38d779afd065590ce97 to your computer and use it in GitHub Desktop.
Save pascaliske/57238467496bd38d779afd065590ce97 to your computer and use it in GitHub Desktop.
Install Node, NPM and Yarn with correct permissions and enabled SIP on macOS 10.13+.

Node, NPM, Yarn

Note: Since macOS High Sierra (10.13) the directory /usr/local/bin is not modifiable anymore (because of Apple's SIP feature). But using node and npm with sudo is not advisable.

Generally it is best practice to install node using an dedicated version manager like n or nvm. This will handle permissions correctly and allows easy upgrading / downgrading the versions.

n
  1. Install node version manager n
curl -L https://git.io/n-install | bash
  1. Install the latest node version with n
n latest
  1. Optional: If you want to use yarn, install it with npm (it's awesome! 😉)
npm i -g yarn
nvm
  1. Install node version manager nvm
curl -o- https://raw.githubusercontent.com/creationix/nvm/v0.33.11/install.sh | bash
  1. Install the latest node version with nvm
nvm install node
  1. Optional: If you want to use yarn, install it with npm (it's awesome! 😉)
npm i -g yarn
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment