DEV Community

Cover image for How I Manage Node & Package Manager Versions in 2025
Michal Bryxí
Michal Bryxí

Posted on

How I Manage Node & Package Manager Versions in 2025

Some time has passed since I wrote How I Manage Node & Package Manager Versions in 2024 and few things have changed. So let's see what has changed and what are still goals:

  1. Things works seamlessly. I switch projects = correct (versions) of tools are automatically used.
  2. Minimal process to setup new projects is needed.
  3. Local development environment and CI use the same ways to ensure consistency.

My stack of choice is node and pnpm, but this should work for most commonly used tools.

In the past I've used nvm, n, volta, corepack, nodeenv. While they all have their own strength, I converged to using proto as the tool of choice.

Installation

  1. If possible, remove all previously versions of node or pnpm to make sure no conflicts occur.
  2. Install proto:
> brew install proto
> proto setup
Enter fullscreen mode Exit fullscreen mode

Project setup

Once you're in your my-app directory, run:

> proto pin node 20.18.0
> proto pin pnpm 9.14.2
Enter fullscreen mode Exit fullscreen mode

It will create my-app/.prototools file with equivalent content, which can be commited to the repo to ensure that every single machine uses the same tool versions when running my-app:

node = "20.18.0"
pnpm = "9.14.2"
Enter fullscreen mode Exit fullscreen mode

And this setup will be automatically honoured every time you run node or pnpm commands inside your project directory:

> node --version
v20.18.0

> pnpm --version
9.14.2
Enter fullscreen mode Exit fullscreen mode

Top comments (0)