DEV Community

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

Posted on

2

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

AWS Security LIVE!

Join us for AWS Security LIVE!

Discover the future of cloud security. Tune in live for trends, tips, and solutions from AWS and AWS Partners.

Learn More

Top comments (0)

AWS Security LIVE!

Tune in for AWS Security LIVE!

Join AWS Security LIVE! for expert insights and actionable tips to protect your organization and keep security teams prepared.

Learn More

👋 Kindness is contagious

Explore a trove of insights in this engaging article, celebrated within our welcoming DEV Community. Developers from every background are invited to join and enhance our shared wisdom.

A genuine "thank you" can truly uplift someone’s day. Feel free to express your gratitude in the comments below!

On DEV, our collective exchange of knowledge lightens the road ahead and strengthens our community bonds. Found something valuable here? A small thank you to the author can make a big difference.

Okay