n – Interactively Manage Your Node.js Versions
Node.js version management: no subshells, no profile setup, no convoluted API, just simple.
this!Want to install Node nightly releases? Try
n is not supported on Windows yet. If you’re able to make it work, send in a pull request!)
Since you probably already have
node, the easiest way to install
n is through
$ npm install -g n
Alternatively, you can clone this repo and
$ make install
bin/n of the directory specified in the environment variable
$PREFIX, which defaults to
/usr/local (note that you will likely need to use
sudo). To install
n in a custom location (such as
PREFIX=$CUSTOM_LOCATION make install.
node versions to subdirectory
n/versions of the directory specified in environment variable
N_PREFIX, which defaults to
/usr/local; the active
iojs version is installed directly in
N_PREFIX. To change the default to, say,
$HOME, prefix later calls to
N_PREFIX=$HOME or add
export N_PREFIX=$HOME to your shell initialization file.
Additionally, consider third-party installer n-install, which allows installation directly from GitHub; for instance,
curl -L https://git.io/n-install | bash
$HOME/n/bin, modifies the initialization files of supported shells to export
N_PREFIX and add
$HOME/n/bin to the
PATH, and installs the latest stable
As a result, both
n itself and all
node versions it manages are hosted inside a single, optionally configurable directory, which you can later remove with the included
n itself to the latest version. See the n-install repo for more details.
n <version> to install a version of
<version> has already been installed (via
n will activate that version.
$ n 0.8.14 $ n 0.8.17 $ n 0.9.6
n on its own to view your currently installed versions. Use the up and down arrow keys to navigate and press enter to select. Use
q or ^C (control + C) to exit the selection screen. If you like vim key bindings during the selection of node versions, you can use
k to navigate up or down without using arrows.
$ n 0.8.14 ο 0.8.17 0.9.6
Use or install the latest official release:
$ n latest
Use or install the latest LTS official release:
$ n lts