How to Set Up Node.js and pnpm with Mise
A short, copy-paste recipe for using mise to pin a Node.js version and enable pnpm via Corepack. Includes a minimal mise.toml snippet and a list of quick verification steps.
I use mise to pin the developer toolchain for a repository so onboarding is
simple and reproducible. This recipe shows the minimal mise.toml entries I
keep in most of my projects when I need Node and pnpm.
Why use mise for Node
- Pin a Node version for consistency across machines and CI.
- Use Corepack to enable and pin
pnpm. - Make project setup simple: clone, run mise, install packages.
Minimal mise.toml
Here is a tiny, practical example. It is intentionally simple and matches the setup I use on this site.
TOML
[tools]
node = "24"
[hooks]
postinstall = "corepack enable pnpm && corepack use pnpm@latest-10"
[settings]
experimental = true
[env]
_.path = ["./node_modules/.bin"]Notes on the snippet
node = "24"pins Node 24. Pick the major you need. mise will fetch it.- The
postinstallhook uses Corepack to enable the bundled package manager shim and selectpnpm10.x. Adjust the tag if you need a different pnpm series. - Adding
./node_modules/.binto the path is handy for local dev tooling.
Setup steps
- Add the
mise.tomlabove to your repository root. - Run
mise install. On a new machine this will install the pinned Node version and makenodeavailable. - Install dependencies with pnpm. Because of the postinstall hook, Corepack
will be configured and
pnpmwill be available.
Shell
mise install
pnpm installVerify
Shell
which node
node --version
pnpm --versionIf the versions match what you expect, the setup worked.
Tips
- If you want to lock
pnpmto a specific minor/patch, change theuseargument to[email protected]or whatever you need. - For CI, add
mise installstep before running any Node commands. - Keep the
postinstallhook idempotent; it will run multiple times but the corepack commands are safe.