Currently I am using Node.js v0.6.16 on Mac OS X 10.7.4. Now I want to upgrade it to the latest Node.js v0.8.1. But after downloading and installing the latest package file from nodejs.org, I found that system is still using v0.6.16 instead of v0.8.1 when I typed 'node -v' in a terminal. Mar 19, 2013 This is a step-by-step process on installing Node.js on Mac OS X. There are several “getting started” tutorials online but I didn’t find much on Mac OS X. The ones I did find were a little confusing since I had no previous experience with Node.js. At the time of this tutorial, I’m running OS X 10.8.2 also known as Mountain Lion. For OS X users is recommended when installing to use the one from node. Should it be better to move to a proper installation of npm? – alicia Mar 21 '17 at 17:35 2.
Development is picking pace, and Node.js is shipping out a new version frequently. It is nice to have the latest version at hand in your development environment to test out new features.
There are a few ways to install Node.js. One of the obvious ones is to download the installer from nodejs.org. However, you might not want to be downloading a new installer every time there's a new version out.
Here are few alternative ways to update to the latest version of Node.js on a Mac.
Nvm is a script-based node version manager. You can install it easily with a curl and bash one-liner as described in the documentation. It's also available on Homebrew.
How To Install Node JS On Mac OS? - PositronX.io
Assuming you have successfully installed nvm. The following will install the latest version of node.
The last option installs all global npm packages over to your new version. This way packages like mocha and node-inspector keep working.
N is an npm-based node version manager. You can install it by installing first some version of node and then running
npm install -g n.
Assuming you have successfully installed n. The following will install the latest version of node.
Homebrew is one of the two popular package managers for Mac. Assuming you have previously installed node with
brew install node. You can get up-to-date with formulae and upgrade to the latest Node.js version with the following.
MacPorts is the other package manager for Mac. The following will update the local ports tree to get access to updated versions. Then it will install the latest version of Node.js. This works even if you have a previous version of the package installed.
There also exists
nodejs alternative to
nodejs-devel that follows the long term support line.