I'm using a Macbook with the latest macOS (10.12.3), and I installed Homebrew by running:
/usr/bin/ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)"
After that I installed node:
brew install node
And tried to upgrade it:
> brew upgrade node
> Error: node 7.8.0 already installed
I got an error saying the version 7.8.0 is already installed, that was expected since I had just installed the most recent version.
Problem: on the terminal I ran:
> node --version
> v4.4.5
and got back an old version that apparently was already installed. Also, when I install some new package through npm
I get a warning saying the package requires an newer version of node.
Question: I seem to have both versions of node installed on my mac, how can I use the most current one? And how can I uninstall all other older node versions?
Thank you very much for your help!
nvm
. I installed it, but when I triednvm use node
ornvm use 7.8.0
it gives me the error that node itself is not installed (in the first case), and that the version is not installed in the second case.brew cleanup
, it seemed to have executed by didn't give me anything in response. After restarting the shellnode --version
still gives me the old node.brew uninstall node
, to remove the brew version of node. And then I followed this stack by runningrm -rf /usr/local/{lib/node{,/.npm,_modules},bin,share/man}/{npm*,node*,man1/node*}
, which seems to have removed the older version of node as well. Now I will try installing with nvm.