The associated package called npm (Node Package Manager) is also installed with node.
To install node on OSX you can download a pre-compiled binary package which makes for an easy installation.
Firstly, browse available packages at http://nodejs.org/ , and download the latest package for your OS X version.
Once the download is completed, open and install the package.
At the end of the install you are prompted to make sure that /usr/local/bin is in your path, double check you have it by opening the Terminal app and typing:
If you don’t already see “/usr/local/bin” in the path, add it in either .bash_profile or .bashrc in your home directory.
> console.log('hello node');
To exit the node session just hit ‘control’ + ‘c’ twice.
If you have an earlier version of node you can just download the latest version and install to upgrade it and it will overight the previous version.
Installing Packages for Node
There are many packages for node, managed using the command npm.
To see a complete list of node packages run:
This will return an exhaustive list of available packages.
To install a package run npm install, like this:
npm install express
To list installed packages run
To upgrade npm packages
To upgrade node.js itself on OSX just download and install the latest from node.org, or install the node updater package n using npm