nodenv
Manage your app's Node.js environment
TLDR
SYNOPSIS
nodenv command [options] [arguments]
DESCRIPTION
nodenv manages multiple Node.js versions per-project. After injecting itself into your PATH, any invocation of `node`, `npm`, `npx`, or other Node.js executables first activates nodenv, which uses shims to intercept commands and route them to the correct version.Version selection uses a hierarchy: NODENV_VERSION environment variable, `.node-version` file in current/parent directories, then the global version setting. This enables project-specific versions without manual switching.The `nodenv install` command is provided by the node-build plugin, included by default in most installation methods (e.g., Homebrew). It downloads prebuilt binaries or compiles Node.js from source.Shims are lightweight executables in `~/.nodenv/shims/` that determine the correct Node version before executing. After installing npm packages with executables, run `nodenv rehash` to create shims for them.The `.node-version` file in a project root specifies the Node version. When you enter the directory, nodenv automatically uses that version.
PARAMETERS
install VERSION
Install Node version.uninstall VERSION
Uninstall Node version.versions
List installed versions.version
Show current version.global [VERSION]
Set/show global version.local [VERSION]
Set/show local version.shell [VERSION]
Set shell-specific version.rehash
Rebuild shim executables.which COMMAND
Show path for command.whence COMMAND
List versions with command.root
Show nodenv root directory.init
Shell initialization.install --list
List available versions.install --list-all
List all versions including old.
CAVEATS
Requires shell initialization in profile (`eval "$(nodenv init -)"` in .bashrc/.zshrc). New global packages need `nodenv rehash`. Building from source takes time and requires build dependencies. Not compatible with nvm. Shims add slight overhead to command startup.
HISTORY
nodenv was created by Will Farrington and Jason Karns around 2014, modeled after rbenv for Ruby. It brought rbenv's proven version management model to Node.js. The plugin architecture enables customization while keeping the core simple.
