Skip to main content

volta

· One min read
Shi Xinyu
Front End Developer

I am currently using nvm, node version manager. And as I am maintaining many projects, I found I am busy switching node and pnpm versions like blow:

node -v
nvm use node 18.19.0

corepack enable
corepack prepare pnpm@8.11.0 --activate

Considering I need to do it multiple times a day, an automation tool becomes a necessity. So I searched and the only answer seems to be Volta.

I like the volta pin function, it pins a volta setting in the package.json file.

{
"volta": {
"node": "16.19.1",
"pnpm": "8.11.0 "
}
}

Next time you enter the folder, volta will change your node version and pnpm version automatically.

The only concern about volta, is that it seems to be built for npm / yarn. Who's not using pnpm these days? But Volta only has limited support for pnpm. https://github.com/volta-cli/volta/issues/737