Skip to content

Instantly share code, notes, and snippets.

@greenstevester
Created January 1, 2022 12:48
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save greenstevester/cf7b7ba1e48b0b64013a4c598618e2ca to your computer and use it in GitHub Desktop.
Save greenstevester/cf7b7ba1e48b0b64013a4c598618e2ca to your computer and use it in GitHub Desktop.
Pre-requisite: brew
NOTE: This install is based on nvm:
see http://dev.topheman.com/install-nvm-with-homebrew-to-use-multiple-versions-of-node-and-iojs-easily/
see also http://stackoverflow.com/questions/28017374/what-is-the-suggested-way-to-install-brew-node-js-io-js-nvm-npm-on-os-x
1. brew update
2. brew install nvm
3. Create NVM's working directory if it doesn't exist:
mkdir ~/.nvm
4. add the following to ~/.bash_profile via
export NVM_DIR="$HOME/.nvm"
. "/usr/local/opt/nvm/nvm.sh"
5. reload the shell to test it
source ~/.bash_profile
echo $NVM_DIR
6. install node (see latest node version at http://nodejs.org/dist/latest/
see https://doesitarm.com/app/nodejs/
nvm install v17
7. To have a node activated by default (not to have to nvm use on each new shell), run this (stable being the id of the version):
nvm alias default v17.3.0
8. verify the install via the following commands.
which node && node --version && npm --version
9. to upgrade nvm
brew upgrade nvm
10. to upgrade npm via nvm (see https://stackoverflow.com/questions/9755841/how-can-i-change-the-version-of-npm-using-nvm)
nvm install-latest-npm
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment