Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

I upgraded node but it still uses the wrong version?

I just ran brew upgrade node and it successfully upgraded Node to version >=4, however node --version returns the old version:

My-MacBook-Pro:~ me$ node --version
v2.3.0
My-MacBook-Pro:~ me$ brew upgrade node
Error: node 4.1.1 already installed

How can I have node use the newest version instead of 2.3.0?

like image 323
Some Guy Avatar asked Jan 13 '16 06:01

Some Guy


1 Answers

First of all, did you run:

brew update

prior to:

brew upgrade

You could also try linking to the correct version:

 brew switch node <version>

To see which versions of node homebrew knows about:

brew info node

If you are on a MAC (as you state) then i would highly recommend using NVM to manage your node and npm versions - and avoid homebrew for this altogether (especially if support for more than one version is likely). This is the best way to install node on a MAC imho.

like image 183
arcseldon Avatar answered Oct 05 '22 04:10

arcseldon