[![Join the chat at https://gitter.im/tj/n](https://badges.gitter.im/Join%20Chat.svg)](https://gitter.im/tj/n?utm_source=badge&utm_medium=badge&utm_campaign=pr-badge&utm_content=badge)
to install `n` to subdirectory `bin/n` of the directory specified in environment variable `PREFIX`, which defaults to `/usr/local` (note that you will likely need `sudo` to install there).
To change the default to, say, `$HOME`, i.e., to install `n` to `$HOME/bin/n`, run `PREFIX=$HOME make install`.
Once installed, `n` downloads node/iojs versions to subdirectory `n/versions` of the directory specified in environment variable `N_PREFIX`, which defaults to `/usr/local`; the _active_ node/iojs version is installed directly in `N_PREFIX`.
To change the default to, say, `$HOME`, prefix later calls to `n` with `N_PREFIX=$HOME ` or add `export N_PREFIX=$HOME` to your shell initialization file.
Alternatively, consider third-party installer [n-install](https://github.com/mklement0/n-install), which allows installation directly from GitHub; for instance,
sets both `PREFIX` and `N_PREFIX` to `$HOME/n`, installs `n` to `$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 node version.
As a result, both `n` itself and all node/iojs versions it manages are hosted inside a single, optionally configurable directory, which you can later remove with the included `n-uninstall` script; script `n-update` updates `n` itself to the latest version - see the [n-install repo](https://github.com/mklement0/n-install) for details.
By default `n` picks the binaries matching your system architecture, e.g. `n` will download 64 bit binaries for a 64 bit system. You can override this by using the `-a` or `--arch` option.
If you would like to use a project other than the official node.js or io.js projects, you can use the special `n project [command]` which allows you to controll the behaviour of `n` using environment variables.
Example:
To grab the latest iojs version but name it "foo" instead,
PROJECT_NAME="foo" PROJECT_URL="https://iojs.org/dist/" n project latest
Required Variables:
*`PROJECT_NAME`: The name the project will be stored under
*`PROJECT_URL`: The location to download the project from. Note, this must folllow the same format as the iojs/node.js repos
Optional Variables:
*`HTTP_USER`: The username if the `PROJECT_URL` is protected by basic authentication
*`HTTP_PASSWORD`: The password if the `PROJECT_URL` is protected by basic authentication
*`PROJECT_VERSION_CHECK`: Many custom projects keep the same version number as the node.js release they are based on, and maintain their own separate version in process. This allows you to define a JavaScript variable that will be used to check for the version of the process, for example: `process.versions.node`