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. You can install it with or without mise. Here is how to install npm
with mise:
sh
mise use -g node
Usage
The following installs the latest version of prettier and sets it as the active version on PATH:
sh
$ mise use -g npm:prettier
$ prettier --version
3.1.0
The version will be set in ~/.config/mise/config.toml
with the following format:
toml
[tools]
"npm:prettier" = "latest"
Settings
Set these with mise settings set [VARIABLE] [VALUE]
or by setting the environment variable listed.
npm.bun
- Type:
Bool
- Env:
MISE_NPM_BUN
- Default:
false
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