Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Unable to change version of node with brew switch

I'm trying to use node 8.9.1 but when trying to update using brew it says 8.9.1 is already installed

James-MacBook:~ james$ brew upgrade node
Error: node 8.9.1 already installed

But when checking the version it shows

James-MacBook:~ james$ node --version
    v0.10.48

So then I tried to switch to 8.9.1

James-MacBook:~ james$ brew switch node 8.9.1
Cleaning /usr/local/Cellar/node/8.9.1
7 links created for /usr/local/Cellar/node/8.9.1

But it is still showing as 0.10.48

James-MacBook:~ james$ node --version
v0.10.48
like image 916
JaAnTr Avatar asked Nov 14 '17 21:11

JaAnTr


1 Answers

It sounds like you have some version of node that is installed without using Homebrew.

  1. First of all, check if you installed your node with nvm by check if you have a .nvm directory in home directory ls -la
    1. if you do, remove that directory
    2. brew update && brew install node@8 (whichever node you want)
    3. brew unlink node@0
    4. brew link --force node@8
    5. Do brew update && brew upgrade node@8

Happy coding

like image 54
willyhakim Avatar answered Oct 21 '22 09:10

willyhakim