pnpm can manage Node.js version like nvm !

rennycat

Jaruwat Thongchana

Posted on October 31, 2022

pnpm can manage Node.js version like nvm !

pnpm is a Node.js package manager like npm, yarn.

If you using nvm or Volta to manage node versions now pnpm can do that too.

Before we start you need to uninstall all of your node, nvm and Volta.

Installation

Install pnpm with standalone script.

curl -fsSL https://get.pnpm.io/install.sh | sh -
Enter fullscreen mode Exit fullscreen mode

Check version after installed.

pnpm -v
Enter fullscreen mode Exit fullscreen mode

Now you can install Node.js with pnpm

Example

Install and use LTS version

pnpm env use --global lts
Enter fullscreen mode Exit fullscreen mode

Install and use specific version

pnpm env use --global 16
Enter fullscreen mode Exit fullscreen mode

Install and use latest version

pnpm env use --global latest
Enter fullscreen mode Exit fullscreen mode

To remove node version use

pnpm env remove --global <version>
Enter fullscreen mode Exit fullscreen mode

refs:

💖 💪 🙅 🚩
rennycat
Jaruwat Thongchana

Posted on October 31, 2022

Join Our Newsletter. No Spam, Only the good stuff.

Sign up to receive the latest update from our blog.

Related