Node environment manager
You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
Go to file
trivernis ad1afd3173
Move commands to nenv instance
All commands are moved to the nenv instance. This
also changes responsibilities slighly and introduces
a shared config object
2 years ago
.github/workflows Add features list to readme 2 years ago
src Move commands to nenv instance 2 years ago
.gitignore Add web api 2 years ago
Cargo.toml Move commands to nenv instance 2 years ago
LICENSE Create LICENSE 2 years ago
README.md Add version detection chapter to README 2 years ago

README.md

nenv

Node environment manager written in rust.

Features

  • Written in fast and safe rust
  • Multiple active nodejs versions at the same time
  • Configuration for project specific versions
  • Version matching with semver expressions

Installation

You can either

  • Install the application with cargo by downloading the repo and running cargo install --path . inside
  • Download the binary from the releases page

Now to initialize everything install any nodejs version with nenv install <version>. Afterwards add the bin directory to your PATH variable.

On windows this should be C:\Users\<yourusername>\AppData\Roaming\nenv\bin. On linux this will should be ~/.local/share/nenv/bin.

Usage

Install node versions

# install the latest available node version
nenv install latest

# install the latest lts version
nenv install lts

# install the latest 14.x.x version.
nenv install 14

Change the system-wide default version

nenv default latest

Refresh installed binaries and upstream versions

nenv refresh

List nodejs versions

nenv list-versions

Version detection

The node version nenv uses is controlled by

  1. The engines.node config field in the package.json which is parsed as a semver requirement.
{
  "name": "my project",
  "engines": {
    "node": "18"
  }
}
  1. The .node-version file in the current or parent directories which contains the version string.
19.4.0  
  1. The NODE_VERSION environment variable.
  2. The default version set with nenv default.

License

GPL-3.0