From 3ff5e7789d9689b32cbccb6aa84ad22804b612c0 Mon Sep 17 00:00:00 2001 From: Melvin PETIT Date: Tue, 16 Jun 2026 12:15:41 +0200 Subject: [PATCH] chore: pin Node toolchain to 22 across machines and CI Docker only containerizes Postgres, so the Node version still drifted between machines (local 22, CI 20, README 20+), which is a source of the recurring environment problems. - Add .nvmrc (22) and engines.node so every checkout targets one Node. - Add .npmrc engine-strict so npm install fails fast on a wrong Node instead of producing a subtly different install. - Bump CI to Node 22 and update the README prerequisite. --- .github/workflows/ci.yml | 6 +++--- .npmrc | 1 + .nvmrc | 1 + README.md | 4 ++-- package.json | 3 +++ 5 files changed, 10 insertions(+), 5 deletions(-) create mode 100644 .npmrc create mode 100644 .nvmrc diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 7adf84d..ce807c2 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -29,7 +29,7 @@ jobs: - name: Setup Node.js uses: actions/setup-node@v6 with: - node-version: 20 + node-version: 22 cache: npm - name: Install dependencies @@ -57,7 +57,7 @@ jobs: - name: Setup Node.js uses: actions/setup-node@v6 with: - node-version: 20 + node-version: 22 cache: npm - name: Install dependencies @@ -81,7 +81,7 @@ jobs: - name: Setup Node.js uses: actions/setup-node@v6 with: - node-version: 20 + node-version: 22 cache: npm - name: Install dependencies diff --git a/.npmrc b/.npmrc new file mode 100644 index 0000000..b6f27f1 --- /dev/null +++ b/.npmrc @@ -0,0 +1 @@ +engine-strict=true diff --git a/.nvmrc b/.nvmrc new file mode 100644 index 0000000..2bd5a0a --- /dev/null +++ b/.nvmrc @@ -0,0 +1 @@ +22 diff --git a/README.md b/README.md index d5c25ed..63d4031 100644 --- a/README.md +++ b/README.md @@ -47,8 +47,8 @@ Early development. Things move fast and not everything listed below is finished. ## Getting started -Prerequisites: Node.js 20 or later, and Docker (for the local database) or your -own PostgreSQL instance. +Prerequisites: Node.js 22 (pinned via `.nvmrc` and `engines`; run `nvm use`), +and Docker (for the local database) or your own PostgreSQL instance. ```bash # 1. Install dependencies diff --git a/package.json b/package.json index 88daaaa..ef1713d 100644 --- a/package.json +++ b/package.json @@ -13,6 +13,9 @@ "license": "SEE LICENSE IN LICENSE", "author": "Melvin PETIT (WhiteMuush)", "type": "module", + "engines": { + "node": "22.x" + }, "scripts": { "predev": "prisma migrate status || echo '\\n[!] Pending migrations or DB unreachable. If the app errors on a missing table, run: npm run db:migrate\\n'", "dev": "next dev",