Skip to content

Latest commit

 

History

History
42 lines (23 loc) · 1.66 KB

environment-variables.md

File metadata and controls

42 lines (23 loc) · 1.66 KB

Environment Variables

Note: if you are using sudo for the install, by default the command you run does not have access to your exported environment variables. You can use sudo -E to pass the existing environment variables.

Custom Install Destination

The nvh command downloads and installs to /usr/local by default, but you may override this location by defining NVH_PREFIX. e.g.

export NVH_PREFIX=$HOME/.nvh
export PATH=$NVH_PREFIX/bin:$PATH

Custom Node Mirror

If the custom mirror requires basic authentication, you can url-encode the username and password directly in the URL:

export NVH_NODE_MIRROR='https://user:password@host/path'

Note: the username and password will be visible (via ps) to other users on your computer while a download is running.

Remote Listings

nvh ls-remote defaults to a showing a maximum of 20 matching versions, but you can change this. e.g.

export NVH_MAX_REMOTE_MATCHES=3

Preserving npm

By default the node install also includes npm and npx. You can change this by setting NVH_PRESERVE_NPM to a non-empty string. This has the same affect as specifying --preserve on the command line, and leaves npm and npx out of the install preserving the current versions.

export NVH_PRESERVE_NPM=1

You can be explicit to get the desired behaviour whatever the environment variable:

nvh install --no-preserve latest
nvh install --preserve nightly

Proxy Server

See also https_proxy in Proxy Server.