I'm trying to install nodejs on mac using homebrew, but when I run the command:
brew install node
I get the following error:
Beginning with 0.8.0, this recipe now comes with npm.
It appears you already have npm installed at /usr/local/lib/node_modules/npm.
To use the npm that comes with this recipe, first uninstall npm with
`npm uninstall npm -g`, then run this command again.
If you would like to keep your installation of npm instead of
using the one provided with homebrew, install the formula with
the `--without-npm` option.
but when I run:
sudo npm uninstall npm -g
I get:
sudo: npm: command not found
When I run the command npm
, I get:
-bash: /usr/local/bin/npm: No such file or directory
so I'm not sure whether it's actually installed or not.
My node version is 0.8.22 (I have no idea where it came from). How should I update it to the latest version?