Skip to main content

Install NodeJS and NPM on Mac

Published: 2019-10-19 • Last updated: 2021-05-03

This will install node version 14.16.0

  1. Download tarball from NodeJS downloads

     curl -O -L
  2. Make dir then extract tarball

     mkdir -p ~/bin/nodejs
     tar -v -x -C ~/bin/nodejs -f node-v14.16.0-darwin-x64.tar.gz
  3. Set environment variables in your bash config file, e.g. ~/.bash_profile

     export NODEJS_HOME=$HOME/bin/nodejs/node-v14.16.0-darwin-x64
     export PATH=$NODEJS_HOME/bin:$PATH
  4. Source bash config file

     source ~/.bash_profile
  5. Confirm installation

     node --version
     npm --version