Brainstorm's snippets (1/243)

  How to Install Node.js and NPM on a Mac

Install node with homebrew:

brew install node

To see if Node is installed:

node -v

To see if NPM is installed:

npm -v

How to Update Node and NPM

brew update
brew upgrade node

How to Uninstall Node and NPM

brew uninstall node

Downgrading Node/NPM

To install a specific NodeJS version with brew, see:

To install a specific NPM version in case NPM is already installed (meaning, to upgrade or downgrade the installed NPM version) you can use NPM itself !

# install a specific NPM version,
# with the `-g` / `--global` flag to replace the previously installed version
npm install -g npm@4


How to use

Then in your project you can finally populate node_modules from package.json as follows:

npm install

How to Install Sass compiler on a Mac

Check if ruby is available:

ruby -v

If not, install it:

brew install ruby

Install Sass:

sudo gem install sass

In case of SSL error "SSL Error When installing rubygems, Unable to pull data from '", try this:

sudo gem sources -r
sudo gem sources -a

the again:

sudo gem install sass

Eventuale aggiornamento dei requirements:

pip install -r requirements/development.txt