How to install specific NodeJS version

katopz
katopz
Dec 7, 2016 · 2 min read

I’ve to downgrade to Node 6 because Node 7 which has some bug that I’ve to avoid. It should be easy task but apparently it’s not, even with Homebrew (don’t ask me to use nvm it’s throw error on me so no joy!) and here’s my answer on stack overflow (after try all that but none of them work).

I’ll write it down here too just in case I need it.

Here’s step by step.

To see your current node version

$ node --version

To see available node versions

$ brew search node

To unlink from current version

$ brew unlink node

Install any version e.g. 6

$ brew install node@6

To link installed version

$ brew link node@6

To see your current node version (again)

$ node --version

This take me 30 minutes to figure this out so it’s worth blog it!

Bonus

To revert to current node version (7.5 ATM)

Gotcha

$ brew link --overwrite node
Linking /usr/local/Cellar/node/7.5.0...
Error: Could not symlink share/doc/node/gdbinit

Solution

$ sudo chown -R $USER /usr/local
$ brew link --overwrite node

katopz

Written by

katopz

DLT & ML Debugger

Welcome to a place where words matter. On Medium, smart voices and original ideas take center stage - with no ads in sight. Watch
Follow all the topics you care about, and we’ll deliver the best stories for you to your homepage and inbox. Explore
Get unlimited access to the best stories on Medium — and support writers while you’re at it. Just $5/month. Upgrade