Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Use node from homebrew

Running node -v in the terminal returns 0.12.2, while running brew info node to check homebrew's version of node, it returns 6.7.0

How can I work using homebrew's node? (6.7.0 instead of 0.12.2)

I've tried reinstalling everything, but it didn't work.

like image 861
gespinha Avatar asked Apr 26 '26 10:04

gespinha


2 Answers

Two options...

Either specify the full path to where hombrew installed node each and every time you use it:

/usr/local/bin/node -v

Or, change your PATH in your login profile to put /usr/local/bin ahead of everything else:

export PATH=/usr/local/bin:$PATH 
like image 80
Mark Setchell Avatar answered Apr 29 '26 06:04

Mark Setchell


Don't use homebrew, use nvm. https://github.com/creationix/nvm

Not only is it easier to install and use, it also allows you to have multiple versions of node/npm installed and switch between them effortlessly (e.g. nvm install v6.7.0 and nvm use v6.7.0)

like image 33
John Halbert Avatar answered Apr 29 '26 07:04

John Halbert



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!