DEV Community

Jaruwat Thongchana
Jaruwat Thongchana

Posted on

17

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:

Top comments (0)

👋 Kindness is contagious

Engage with a sea of insights in this enlightening article, highly esteemed within the encouraging DEV Community. Programmers of every skill level are invited to participate and enrich our shared knowledge.

A simple "thank you" can uplift someone's spirits. Express your appreciation in the comments section!

On DEV, sharing knowledge smooths our journey and strengthens our community bonds. Found this useful? A brief thank you to the author can mean a lot.

Okay