I'm using brew. I have node installed, using brew. I want to use an earlier version of node.

Online, I find instructions such as, for example:

cd /usr/local/Library/Formula
brew remove node --force
brew versions node
git checkout 83988e4 /usr/local/Library/Formula/node.rb
brew install node

The problem I have with this is that brew doesn't seem to have a versions subcommand:

$ brew versions node
Error: Unknown command: versions
$ brew --version

I'm new to brew. Do I need to enable the versions subcommand somehow? Should I use a different subcommand instead? Is there a completely different method I should try?

I'm running OS X Yosemite (10.10.1); brew 0.9.5.

  • Which version of node.js are you looking to get installed?
    – bmike
    Commented Feb 11, 2015 at 17:12
  • My boss tells me 10.32. I guess he means 0.10.32. I have 0.12.0 installed right now.
    – dave4420
    Commented Feb 11, 2015 at 17:19
  • At this date the reader should go to this answer : stackoverflow.com/a/4158763/48136
    – bric3
    Commented Oct 10, 2018 at 13:21

13 Answers 13


These days if you want to install a different version of node you do it this way:

First search for your desired package:

brew search node

This might give you the follow results:

heroku/brew/heroku-node ✔
node ✔
node@12 ✔
node@14 ✔

And then install the desired version:

brew install node@14

Also remember that you can install more than 1 node package at the same time, but you cannot have them available at the same time. So if you have the latest/generic node package already installed you need to unlink it first:

brew unlink node

And then you can link a different version:

brew link node@14

Sometimes it might be required to link them with the --force and --overwrite options:

brew link --force --overwrite node@14

However, when new node version comes out and you’ll update to it by running brew upgrade, the link will be removed and the most recent node version will be linked instead. To remedy that you might consider adding your desired node version to PATH instead (and restart the shell):

echo 'export PATH="/usr/local/opt/node@14/bin:$PATH"' >> ~/.zshrc

(replace .zshrc with .bashrc or similar, depending on which $SHELL you use)

  • I was using the latest node (node@22 by default) version via the Homebrew formulae.brew.sh/formula/node#default today. Unlinking node and linking node@20 (to use LTS for projects) works great! And yeah, i've got the error "Error: Could not symlink lib/node_modules/npm/LICENSE" when tried to link node@20, but again, brew link --overwrite node@20 works fine as well. Thanks!
    – hamsternik
    Commented May 29 at 13:18

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. 8

$ brew install node@8

To link installed version

$ brew link node@8

To see your current node version (again)

$ node --version
  • Just what I needed Commented Mar 27, 2017 at 14:47
  • How to solve this issue ? brew link node@10 Warning: node@10 is keg-only and must be linked with --force If you need to have this software first in your PATH instead consider running: echo 'export PATH="/usr/local/opt/node@10/bin:$PATH"' >> ~/.bash_profile
    – vikramvi
    Commented Oct 29, 2018 at 10:23
  • didn't work on Mac OS 10.13.5, getting error stackoverflow.com/questions/53043476/…
    – vikramvi
    Commented Oct 29, 2018 at 10:33
  • 1
    how can I install specific version of node, I have install node version "10.17.0" with command brew install node@10, but I need to install "10.15.3".
    – codemilan
    Commented Nov 5, 2019 at 6:03
  • @codemilan, why would you need a specific minor version?
    – Timo
    Commented Dec 25, 2023 at 13:37

As of this PR to homebrew/versions and this PR to homebrew, the answers involving brew tap homebrew/versions or *-lts packages no longer work.

The correct answer is now:

brew install node@<version>

Where <version> is 0.10, 0.12, 4, etc. For example, to install Node.js v6 (as of this writing, the most recent LTS version):

brew install node@6

You may need to run brew update prior to these commands to ensure that these new versioned formulae are available. If you have another version of the node formula installed, you'll also need to run brew unlink node first.


brew versions has to be installed at some point after you install brew.

$ brew tap homebrew/boneyard

You can then use the brew versions command as the instructions assume.

  • 4
    homebrew/boneyard is outdated and going to be replaced with github.com/Homebrew/homebrew-versions as of March 2015. Install via brew tap homebrew/versions. Commented Mar 2, 2015 at 11:04
  • 12
    With homebrew/versions you will get versioned name of the package: brew search node => leafnode node node010 node04 node06 node08 nodebrew .... So do brew install node010 followed by brew link --overwrite node010 to install the 0.10 version of Node.JS. Commented Mar 2, 2015 at 11:12
  • 3
    You might also need to brew unlink node before you brew install node010
    – chananelb
    Commented May 19, 2015 at 9:31

FYI, if you previously had the old version installed and haven't run brew cleanup (which deletes old versions), you can switch with something like brew switch node 5.7.0

All installed versions of node can be listed by running brew info node or ls -l /usr/local/Cellar/node/

See the brew command cheat sheet: http://ricostacruz.com/cheatsheets/homebrew.html

  • Works as of 2017/12! Homebrew 1.4.0-17-gc912d26 Commented Dec 14, 2017 at 18:49

There are a lot of answers here and other places that say to use homebrew-versions, but that gives you very limited options for which version of Node you can install.

It's much easier to use NVM and it allows you to switch between versions very easily.

homebrew install nvm

Then follow the instructions in the caveats -- mkdir ~/.nvm and add two lines to your .bash_profile and source .bash_profile

Then simply run nvm install <version> for all the versions you need. Then nvm use <version> to switch.

  • This is not the accepted answer, but it is the only one that worked for me. I wish I had tried this one the first, because I would have saved a lot of time.
    – Alex
    Commented Jul 15, 2018 at 20:23

If you need it just specifically for Node, you can use nvm. It is very convenient if you work with Node a lot.

  • According to nvm docs brew and nvm are not a supported combo. I commented on this here. github.com/angular/angular-cli/issues/… I'd be interested in hearing any war stories on this. Because on the surface I seem to have this working despite the fact it's "not supported"
    – JGFMK
    Commented Jun 28, 2017 at 10:03

The preferred way in the NodeJS world is using the tool n

  • Installation: npm install -g n
  • Install Node 8.8.4 n 8.8.4
  • List all your locally available node versions and chose one: n

It seems similar to nvm, but I had issues with nvm, and n worked out of the box.


You can do it without homebrew.

You can uninstall and then install the node manually.

You have to download your current running version. Here is the list.

Download the node-v{your-current-version-number}.tar.gz, extract it and then go to command line.

cd node-v{your-current-version-number}
sudo make install

To uninstall it sudo make uninstall

Then download the version you want to install and follow same steps above.

From this blog post

  • +1 this answer. FWIW, I was just able to copy the untarred bin/ folder to my PATH to get this working.
    – shicholas
    Commented Jun 16, 2015 at 18:30
  • 1
    Even better, you can download the .pkg file from there and double-click it to install.
    – Henrik N
    Commented Jun 6, 2019 at 10:52

If you faced troubles with homebrew to install any version of node, you can just download .pkg file for OSX from https://nodejs.org/dist/[VERSION_YOU_NEED]. This is only helps me to reinstall node


Let's imaging that you have 0.12.* version. To install (downgrade) 0.10 version of node throw the brew in OSX, you have to:

$ sudo brew tap homebrew-versions
$ brew unlink node
$ brew install https://raw.githubusercontent.com/Homebrew/homebrew-versions/master/node010.rb
$ node -v

List of all node versions is here


as an example to downgrade from node@14 to node@12 using homebrew is first you need to install node@12

  brew install node@12

Then unlink node@14

  brew unlink node@14

Then link node@12

  brew link node@12

Then replace the path to bin folder

  echo 'export PATH="/usr/local/opt/node@12/bin:$PATH"' >> ~/.zshrc

Uninstall node@14

  brew uninstall node@14

check the node version

  node -v
  • Doesn't Homebrew link everything to /opt/homebrew/bin anyway? If not, you may also need to remove /usr/local/opt/node@14/bin from PATH.
    – nohillside
    Commented Dec 21, 2021 at 8:14


You can go here and install the version you need.

Before installing you might want to run brew unlink node to unlink the current version.

  • 1
    What would the advantage be of doing it this way, as opposed to using brew (as several other answers describe) or uninstalling node and then manually installing it (as @Terente-Ionut-Alexandru's answer described)?
    – John N
    Commented Mar 16, 2017 at 10:47
  • @JohnN brew versions is deprecated as of now.Its alternatives are not very easy to understand. Also, it is kinda complex through brew to install the exact version. Commented Mar 16, 2017 at 11:17
  • @Paweł-Gościcki's answer (the highest rated, with 140 votes) seems very easy to understand, and not at all complex - which matches my recent experience with brew and different versions of formulae. My point is that your answer doesn't seem to add to anything that hasn't already been said in other answers - unless there's a reason to unlink+manually install rather than uninstall+manually install, as Terente suggested?
    – John N
    Commented Mar 16, 2017 at 11:59
  • @JohnN That ofcourse, is easy to understand . But you will be limited by options that brew search gives. For eg. if you want node 4.4.6 exactly but the brew will only provide a node@4 option. Hence. Commented Mar 17, 2017 at 7:47
  • 1
    There are, I think, 3 decent answers to the question: (1) use brew, (2) use nvm, and (3) uninstall and manually install. What I'm trying to get you to do is explain why your answer adds to these existing answers. Why do you feel that unlinking+manually installing is preferable to the existing answers? Specifically, why do you feel that *unlinking*+manually installing is better than *uninstalling*+manually installing, as Terente's answer suggests?
    – John N
    Commented Mar 17, 2017 at 7:55

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .