Calm Development Environment: Node.js, Corepack, Yarn and Static Preview

A development environment should be boring.

Not weak.
Not outdated.
Just boring in the best possible way: predictable, explicit, easy to reset, and easy to explain.

This article describes a small Node.js environment setup for Vyriy-style development:

  • Node.js is managed by nvm
  • the active runtime is the latest LTS line
  • package managers are managed by Corepack
  • Yarn is activated through Corepack
  • global npm tools are kept minimal
  • static builds can be previewed from any folder

The goal is not to turn the environment into a special snowflake.

The goal is to keep the environment as a clean foundation, while each project owns its real toolchain.

Target environment

For professional Node.js development, I prefer Linux, macOS, or WSL.

Node.js can run natively on Windows, but a production Node.js environment is usually Linux-based: containers, CI runners, serverless runtimes, virtual machines, and most cloud deployments are closer to Linux than to native Windows.

That does not mean Windows is unusable for development. It means the Node.js toolchain should run in an environment that behaves as close as possible to production.

For a Windows workstation, WSL is the preferred option:

Windows host
└── WSL Linux development environment
    ├── nvm
    ├── Node.js LTS
    ├── Corepack
    ├── Yarn
    └── project dependencies

This keeps filesystem behavior, shell scripts, permissions, paths, and CI expectations closer to a real deployment environment.

Why calm setup matters

JavaScript projects often become unstable not because the code is complex, but because every machine has a slightly different global environment.

One machine has old Node.js.
Another has globally installed Yarn Classic.
Another has a random package manager version from three projects ago.
CI uses something else.
The project works, but nobody is fully sure why.

A calm setup tries to avoid that.

The development environment should provide only the base layer:

  • Node.js
  • npm bundled with Node.js
  • Corepack
  • package manager shims
  • a few small helper CLIs

Everything else should live in the project:

  • TypeScript
  • ESLint
  • Prettier
  • Jest
  • Storybook
  • Webpack
  • Babel
  • framework dependencies
  • project-specific scripts

That keeps the environment simple and replaceable.

Current baseline

At the time of writing, Node.js 24.x is the active LTS line with the codename Krypton, while Node.js 26.x is Current, not LTS.

So for this setup I use:

lts/krypton

This is explicit enough for documentation and still works with nvm.

Prerequisites

This guide assumes that nvm is already installed.

Check it:

nvm --version

Check currently installed Node.js versions:

nvm ls

This only shows versions managed by nvm.

It does not control Node.js installed through:

  • apt
  • brew
  • Windows installer
  • Docker images
  • CI images
  • IDE-managed runtimes

Resetting Node.js versions managed by nvm

In this setup, we do not remove nvm itself.

The goal is only to remove Node.js versions installed through nvm, then install the current LTS version again.

Check installed versions:

nvm ls

or:

nvm list

Option A: uninstall versions one by one

This is the most explicit option.

Deactivate the current Node.js version first:

nvm deactivate || true

Then uninstall versions manually:

nvm uninstall v20.18.0
nvm uninstall v22.13.1
nvm uninstall v23.11.0

Replace these versions with the versions shown by your own nvm ls output.

Check the result:

nvm ls

Option B: remove all nvm-managed Node.js versions at once

If you want to remove all Node.js versions installed through nvm, remove the versions/node directory contents:

rm -rf "${NVM_DIR:-$HOME/.nvm}/versions/node"/*

or, if you use the default nvm location:

rm -rf ~/.nvm/versions/node/*

Then check again:

nvm ls

This keeps nvm installed, but removes all Node.js versions installed through it.

It does not remove Node.js installed through other tools such as apt, brew, Windows installer, Docker, or CI images.

Install Node.js LTS

Install the current LTS line:

nvm install lts/krypton --latest-npm

Use it:

nvm use lts/krypton

Set it as default:

nvm alias default lts/krypton

Check versions:

node -v
npm -v

Update npm

Node.js already ships with npm, and nvm install ... --latest-npm asks nvm to install the latest npm that fits that Node.js version.

Still, for a environment setup, I like to make npm update explicit:

npm install -g npm

Check it:

npm -v

If npm ever reports an engine compatibility error, keep the npm version bundled with the current Node.js LTS or install a compatible npm major version explicitly.

Enable Corepack

Corepack lets Node.js manage package manager versions.

Enable it:

corepack enable

Check it:

corepack --version

Activate stable Yarn

Activate stable Yarn through Corepack:

corepack prepare yarn@stable --activate

Check Yarn:

yarn -v

This gives you a global Yarn shim managed by Corepack.

The important part: we are not installing Yarn globally with npm.

For modern projects, Corepack is the cleaner approach.

Pin Yarn inside a project when needed

This command should not be run from a random folder:

yarn set version berry

It is project-local.

Use it only inside a repository:

cd my-project
yarn set version berry

Then check what changed:

git status

Depending on the Yarn version and configuration, you may see files such as:

.yarnrc.yml
.yarn/releases/...

For Vyriy-style projects, this is useful when the repository should pin its own package manager version and keep installs reproducible.

Final copy-paste flow

Use this block when you want to reset Node.js versions managed by nvm and install the calm development baseline again.

Important: this keeps nvm installed, but removes all Node.js versions installed through nvm. It does not remove system Node.js installations from apt, brew, Windows installer, Docker, or CI images.

# 1. Review currently installed nvm-managed Node.js versions
nvm ls

# 2. Deactivate current Node.js version if needed
nvm deactivate || true

# 3. Remove all Node.js versions installed through nvm
rm -rf "${NVM_DIR:-$HOME/.nvm}/versions/node"/*

# 4. Install and use Node.js LTS
nvm install lts/krypton --latest-npm
nvm use lts/krypton
nvm alias default lts/krypton

# 5. Update npm
npm install -g npm

# 6. Enable Corepack and activate stable Yarn
corepack enable
corepack prepare yarn@stable --activate

Project setup example

Inside a new project:

mkdir my-project
cd my-project
yarn init

Pin Yarn Berry locally:

yarn set version berry

Check generated files:

git status

Install dependencies:

yarn install

Calm development rule

The development environment should not know too much.

It should provide the foundation:

Node.js
npm
Corepack
Yarn shim

The project should define the real toolchain:

TypeScript
ESLint
Prettier
Jest
Storybook
Webpack
Babel
React
AWS CDK
project scripts

That separation keeps the setup simple.

A calm environment is easy to reset.
A calm project is easy to reproduce.
A calm toolchain is explicit enough that the next developer can understand it without guessing.

That is the main idea of a calm development environment.