npm Backend
You may install packages directly from npmjs.org even if there isn't an asdf plugin for it.
The code for this is inside of the mise repository at ./src/backend/npm.rs.
Dependencies
This relies on having npm installed for resolving package versions. If you use bun or pnpm as the package manager, they must also be installed.
Here is how to install npm with mise:
mise use -g nodeTo install bun or pnpm:
mise use -g bun
# or
mise use -g pnpmUsage
The following installs the latest version of prettier and sets it as the active version on PATH:
$ mise use -g npm:prettier
$ prettier --version
3.1.0The version will be set in ~/.config/mise/config.toml with the following format:
[tools]
"npm:prettier" = "latest"Settings
Set these with mise settings set [VARIABLE] [VALUE] or by setting the environment variable listed.
npm.bundeprecated
- Type:
Bool - Env:
MISE_NPM_BUN - Default:
false - Deprecated: Use npm.package_manager instead.
If true, mise will use bun instead of npm if
bun is installed and on PATH.
This makes installing CLIs faster by using bun as the package manager.
You can install it with mise:
mise use -g bun
npm.package_manager
- Type:
string - Env:
MISE_NPM_PACKAGE_MANAGER - Default:
npm
Package manager to use for installing npm packages. Can be one of:
npm(default)bunpnpm