Jan 25, 2017 - Learn to install Node.js on macOS with this fast tutorial - get up. This guide covers installing Node.js on the following versions of OS X and macOS: OS X. Sudo npm install npm --global // Update the `npm` CLI client. Jun 29, 2018 - There are several ways to install Node.js and NPM on the Mac, including using a prebuilt packaged installer, or by using Homebrew.
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 'nodemodules' in my '/usr/local/lib'. I've tried uninstalling npm and reinstalling it following 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. For brew users, OSX: To remove: brew uninstall node; # or `brew uninstall -force node` which removes all versions brew cleanup; rm -f /usr/local/bin/npm /usr/local/lib/dtrace/node.d; rm -rf /.npm; To install: brew install node; which node # = /usr/local/bin/node export NODEPATH='/usr/local/lib/nodemodules' # nvm uninstall v4.1.0 nvm install v8.1.2 nvm use v8.1.2 nvm list v4.2.0 v5.8.0 v6.11.0 - v8.1.2 system. to automatically switch versions as you hop between different projects with different node dependencies.
I'm not sure if it's because I had an old version (4.4.5), or if it's because I used the official installer, but most of the files referenced in other answers didn't exist on my system. I only had to remove the following: /.node-gyp /.nodereplhistory /usr/local/bin/node /usr/local/bin/npm /usr/local/include/node /usr/local/lib/dtrace/node.d /usr/local/lib/nodemodules /usr/local/share/doc/node /usr/local/share/man/man1/node.1 /usr/local/share/systemtap/tapset/node.stp I decided to keep /.npm because I was planning on reinstalling Node with Homebrew.