---
title: "Changing Node Versions"
date: "2016-01-27"
category: "node"
slug: "changing-node-versions"
---

Multiple Node.js versions can be installed and managed using [nvm](https://github.com/creationix/nvm) on [[determining-platform-version]] and newer platforms.

## Listing Installed Versions

nvm is provided automatically. To list available Node interpreters, run `nvm ls` from the [[accessing-terminal]]:

```
$ nvm ls
 v4.2.4
 v5.5.0
-> system
node -> stable (-> v5.5.0) (default)
stable -> 5.5 (-> v5.5.0) (default)
iojs -> N/A (default)
```

`system` refers to the system default. Use `nvm ls-remote` to show all remote versions available for installation.

## Installing a Version

To install a specific Node version, run `nvm install <version>`:

```
$ nvm install v4.5.1
 Downloading https://nodejs.org/dist/v5.4.1/node-v5.4.1-linux-x64.tar.xz...
 ######################################################################## 100.0%
 WARNING: checksums are currently disabled for node.js v4.0 and later
 Now using node v5.4.1 (npm v3.3.12)

```

## Switching Versions

Switch between installed versions with `nvm use <version>`:

$ nvm use 5.4.1
Now using node v5.4.1 (npm v3.3.12)
$ node -v
v5.4.1

To set a default version for future sessions:

`nvm alias default <version>`

## Finding the Node Path

Once you have selected a Node interpreter, find its absolute path using `which`:

$ which node
~/.nvm/versions/node/v5.4.1/bin/node

Expand `~` to your [[home-directory-location]]. This path can be used with the `PassengerNodejs` directive when [[running-node-js]] to specify a custom Node interpreter.

## See Also

- [nvm documentation](https://github.com/creationix/nvm/blob/master/README.markdown) (github.org)
- [[running-node-js]]
