Node
Like nvm, (or volta, fnm or asdf...), mise can manage multiple versions of Node.js on the same system.
The following are instructions for using the node mise core plugin. This is used when there isn't a git plugin installed named "node". If you want to use asdf-nodejs then run
mise plugins install node https://github.com/asdf-vm/asdf-nodejs
The code for this is inside the mise repository at ./src/plugins/core/node.rs.
Usage
The following installs the latest version of node-20.x and makes it the global default:
mise use -g node@20See the Node.JS Cookbook for common tasks and examples.
.nvmrc and .node-version support
By default, mise uses a mise.toml file for auto-switching between software versions.
It also supports .tool-versions, .nvmrc or .node-version file to find out what version of Node.js should be used. This will be used if node isn't defined in mise.toml.
This makes it a drop-in replacement for nvm. See idiomatic version files for more information.
Default node packages
mise-node can automatically install a default set of npm packages right after installing a node version. To enable this feature, provide a $HOME/.default-npm-packages file that lists one package per line, for example:
lodash
request
expressYou can specify a non-default location of this file by setting a MISE_NODE_DEFAULT_PACKAGES_FILE variable.
"nodejs" -> "node" Alias
You cannot install/use a plugin named "nodejs". If you attempt this, mise will just rename it to "node". See the FAQ for an explanation.
Building from source
If compiling from source, see BUILDING.md in node's documentation for required system dependencies.
mise settings node.compile=1
mise use node@latestUnofficial Builds
Nodejs.org offers a set of unofficial builds which are compatible with some platforms that are not supported by the official binaries. These are a nice alternative to compiling from source for these platforms.
To use, first set the mirror url to point to the unofficial builds:
mise settings node.mirror_url=https://unofficial-builds.nodejs.org/download/release/If your goal is to simply support an alternative arch/os like linux-loong64 or linux-armv6l, this is all that is required. Node also provides flavors such as musl or glibc-217 (an older glibc version than what the official binaries are built with).
To use these, set node.flavor:
mise settings node.flavor=musl
mise settings node.flavor=glibc-217Settings
node.cflags
- Type:
string(optional) - Env:
MISE_NODE_CFLAGS - Default:
None
Additional CFLAGS options (e.g., to override -O3).
node.compile
- Type:
boolean(optional) - Env:
MISE_NODE_COMPILE - Default:
None
Compile node from source.
node.concurrency
- Type:
integer - Env:
MISE_NODE_CONCURRENCY - Default:
Number of physical CPUs (unless ninja is enabled)
Number of parallel jobs for node compilation. Defaults to the number of physical CPU cores when using make. When ninja is enabled, this defaults to unset (ninja handles concurrency automatically).
node.configure_opts
- Type:
string(optional) - Env:
MISE_NODE_CONFIGURE_OPTS - Default:
None
Additional ./configure options.
node.corepack
- Type:
boolean - Env:
MISE_NODE_COREPACK - Default:
false
Installs the default corepack shims after installing any node version.
node.default_packages_file
- Type:
string - Env:
MISE_NODE_DEFAULT_PACKAGES_FILE - Default:
~/.default-npm-packages
Path to a file containing packages to install with npm after installing a new Node.js version.
Defaults to ~/.default-npm-packages. Also checks ~/.default-nodejs-packages and ~/.default-node-packages for backwards compatibility.
Format: one package per line, with optional version specifier:
lodash
typescript@latest
@types/node@^20
node.flavor
- Type:
string(optional) - Env:
MISE_NODE_FLAVOR - Default:
None
Install a specific node flavor like glibc-217 or musl. Use with unofficial node build repo.
node.gpg_verify
- Type:
boolean(optional) - Env:
MISE_NODE_GPG_VERIFY - Default:
None
Use gpg to verify node tool signatures.
node.make
- Type:
string(optional) - Env:
MISE_NODE_MAKE - Default:
None
Make command to use.
node.make_install_opts
- Type:
string(optional) - Env:
MISE_NODE_MAKE_INSTALL_OPTS - Default:
None
Additional make install options.
node.make_opts
- Type:
string(optional) - Env:
MISE_NODE_MAKE_OPTS - Default:
None
Additional make options.
node.mirror_url
- Type:
string(optional) - Env:
MISE_NODE_MIRROR_URL - Default:
None
Mirror to download node tarballs from.
node.ninja
- Type:
boolean - Env:
MISE_NODE_NINJA - Default:
Auto-detected: true if ninja is on PATH
If true, use ninja build system instead of make for faster compilation.
Defaults to true if ninja is found on PATH, false otherwise.
Ninja is generally faster than make for incremental builds.
node.nodenv_root
- Type:
string - Env:
NODENV_ROOT - Default:
~/.nodenv
Directory for nodenv.
node.nvm_dir
- Type:
string - Env:
NVM_DIR - Default:
~/.nvm
Directory for nvm.
node.verify
- Type:
boolean - Env:
MISE_NODE_VERIFY - Default:
true
Verify the downloaded assets using GPG.