My version of node is always v0.6.1-pre even after I install brew node and NVM install v0.6.19.
My node version is:
node -v
v0.6.1-pre
NVM says this (after I install a version of node for the first time in one bash terminal):
nvm ls
v0.6.19
current: v0.6.19
But when I restart bash, this is what I see:
nvm ls
v0.6.19
current: v0.6.1-pre
default -> 0.6.19 (-> v0.6.19)
So where is this phantom node 0.6.1-pre version and how can I get rid of it? I'm trying to install libraries via NPM so that I can work on a project.
I tried using BREW to update before NVM, using "brew update" and "brew install node". I've tried deleting the "node" directory in my /usr/local/include and the "node" and "node_modules" in my "/usr/local/lib". I've tried uninstalling npm and reinstalling it following these instructions.
All of this because I was trying to update an older version of node to install the "zipstream" library. Now there's folders in my users directory, and the node version STILL isn't up to date, even though NVM says it's using 0.6.19.
Ideally, I'd like to uninstall nodejs, npm, and nvm, and just reinstall the entire thing from scratch on my system.
$node --version
v11.1.0
$nvm deactivate
$nvm uninstall v11.1.0
Worked for me
Apparently, there was a
/Users/myusername/local
folder that contained ainclude
withnode
andlib
withnode
andnode_modules
. How and why this was created instead of in my/usr/local
folder, I do not know.Deleting these local references fixed the phantom v0.6.1-pre. If anyone has an explanation, I'll choose that as the correct answer.
EDIT:
You may need to do the additional instructions as well:
which is the equivalent of (same as above)...
or (same as above) broken down...
To completely uninstall node + npm is to do the following:
You may also need to do:
Additionally, NVM modifies the PATH variable in
$HOME/.bashrc
, which must be reverted manually.Then download nvm and follow the instructions to install node. The latest versions of node come with npm, I believe, but you can also reinstall that as well.
I have been hit by an issue during uninstall of Node.js on my mac. I had some strange behavior like
npm
is still their even after having removing it with all this.It was because I had an old install done with macport. So you also have to uninstall it using port:
It may have install many different versions of Node.js so uninstall them all (one by one).
For brew users, OSX:
To remove:
To install:
You can run
brew info node
for more details regarding your node installs.consider using NVM instead of brew
NVM (node version manager) is a portable solution for managing multiple versions of node
https://github.com/creationix/nvm
The best way is to download an installer package: .pkg on mac. Prefer the latest stable version.
Here is the link: Node.js
This package will eventually overwrite the previous version and set environment variables accordingly. Just run the installer and its done within a few clicks.
You can clone https://github.com/brock/node-reinstall and run the simple command as given in the repository.After that just restart your system.
This is the simplest method and also worked for me.