upgrade-node
Skill4 starsChanged 10 days agoMITView on GitHub
Upgrade a project's Node.js version to a supported LTS (24 or 26) - pick the target, update .nvmrc, engines, package-manager and type versions, CI matrices, Dockerfiles and deploy runtimes together, rebuild native modules, handle removed or changed APIs, and verify with tests and a production-image smoke test. Use when asked to upgrade Node, when legacy/node-legacy applies (Node 20 or older, or an odd-numbered line), or before Node 22 reaches EOL on 30 Apr 2027.
- Installs packages
In this repository32 other files it gives its agents.
- llms.txtllms.txt
- cve-checkSkill
- dependency-vetSkill
- git-commitSkill
- incident-supply-chainSkill
- migrate-angularjsSkill
- migrate-class-to-hooksSkill
- migrate-cordovaSkill
- migrate-cra-to-viteSkill
- migrate-dotnet-frameworkSkill
- migrate-ingress-nginxSkill
- migrate-strutsSkill
- migrate-vue2Skill
- migrate-xamarinSkill
- secrets-scanSkill
- security-auditSkill
- threat-model-liteSkill
- upgrade-angularSkill
- upgrade-djangoSkill
- upgrade-dotnetSkill
- upgrade-expressSkill
- upgrade-jquerySkill
- upgrade-laravelSkill
- upgrade-nestjsSkill
- upgrade-nextjsSkill
- upgrade-nuxtSkill
- upgrade-phpSkill
- upgrade-pythonSkill
- upgrade-railsSkill
- upgrade-react-nativeSkill
- upgrade-spring-bootSkill
- upgrade-supabaseSkill
The file
We split this skill into the rules it gives an agent
7 rules. About 0 are common, 4 are distinctive, and 3 are very specific to this project.
≈0
Common · estimate
Many files like this have a rule of this kind.
≈4
Distinctive · estimate
This author's own choices. Worth a look.
3
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- could be automatic: a setting could enforce it
- Very specific: line 42
Reinstall and rebuild: delete node_modules, run the clean install, and run npm rebuild for native modules.
- Very specific: line 44
Tooling: update the test runner, bundler and TypeScript if they don't support the new Node (Vitest 5 and Jest 30 support current LTS …
- Distinctive: line 65
Never update only some pins.
- Distinctive: line 66
Never upgrade Node, a framework major and the module system in one change.
- Very specific: line 67
Never skip a failing native module with --ignore-scripts or by deleting it.
- Distinctive: line 68
Never disable TLS checks or deprecation errors to make the upgrade pass.
- Distinctive: line 69
Never auto-commit, push or deploy.
≈ “Common” is an estimate: at least 1 in 5 of the 350,495 skill files we read have a rule of the same kind, not the same words. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.
Files
Upgrade Node.js
When to use
- The user asks to upgrade Node, or the project runs an EOL line (20 or older, or 25/23/21) — see
legacy/node-legacy. - Node 22 is in use and the user wants to move before its EOL on 30 Apr 2027.
- A dependency now requires a newer Node.
For a minor or patch update on a supported line, update the pins (step 3) and run Verify.
Before you start
- List every place that pins Node, and note mismatches:
.nvmrc,.node-version,.tool-versions,volta,engines.node,packageManager, Dockerfiles (FROM node:…), CI (node-version:, matrices), serverless and PaaS runtimes (runtime: nodejs20.x,vercel.json, buildpacks), and@types/node. - List native and toolchain-sensitive dependencies:
bcrypt,sharp,canvas,sqlite3/better-sqlite3,node-sass,grpc, anything withbinding.gypornode-gyp/prebuildin its install scripts (npm ls --all | grep -E "gyp|prebuild"). - Working tree clean; new branch (
chore/node-26). - Ask the user:
- the target: Node 26 (Active LTS since 28 Oct 2026, EOL 30 Apr 2029; longest runway) or Node 24 (Maintenance LTS, EOL 30 Apr 2028; more conservative). Default to 26 for apps, and for libraries keep
enginesas wide as the supported lines (>=22); - where it runs (containers, serverless, PaaS) and whether that platform offers the target runtime yet;
- whether network installs are approved (
core/supply-chaincooldown applies).
- the target: Node 26 (Active LTS since 28 Oct 2026, EOL 30 Apr 2029; longest runway) or Node 24 (Maintenance LTS, EOL 30 Apr 2028; more conservative). Default to 26 for apps, and for libraries keep
Steps
- Baseline on the current version: clean install, lint, typecheck, tests, build, and start the production image. Record failures; don't blame them on the upgrade later.
- Plan the hop. Go straight to the target when tests are good and there are no unmaintained native modules. From 18 or older with native modules or old toolchains (Webpack 4,
node-sass, Jest < 29), hop one LTS at a time (18 → 20 → 22 → 24/26) and fix each hop. - Update all pins in one change:
.nvmrc/.node-version/.tool-versions→ the exact target (for example26.13.0);engines.node→>=26for apps (or the supported range for libraries);@types/node→ the target major (npm install -D @types/node@26);- Dockerfiles →
node:26-slim@sha256:<digest>(look up the real digest; seedevops/docker); - CI →
node-version-file: .nvmrcor the matrix of supported lines; - deploy runtimes → the platform's matching runtime identifier.
- Reinstall and rebuild: delete
node_modules, run the clean install, and runnpm rebuildfor native modules. Update native packages that have no prebuilt binaries for the new ABI to versions that do; replace unmaintained ones (node-sass→sass). - Fix API changes. Run the tests and read deprecation warnings (
node --trace-deprecation). The Node.js userland migrations project publishes codemods for common removals; review their diffs. Typical items: removed or runtime-deprecatedutil.is*,url.parse()→new URL(),Buffer()constructor →Buffer.from/alloc,fs.rmdir(…, { recursive })→fs.rm, crypto defaults, and stricter TLS (old ciphers and certificates rejected). - Tooling: update the test runner, bundler and TypeScript if they don't support the new Node (Vitest 5 and Jest 30 support current LTS lines), and the package manager (
corepackor the pinnedpackageManagerversion). - Verify (next section), show the diff and results, and wait for approval; commit only when asked (
git-commitskill). Then uselanguages/javascript-node.
Verify
node --version # the target, on every runner
npm ci
npm rebuild
npm run lint
npx tsc --noEmit # TypeScript projects
npm test
npm run build
npm audit --audit-level=moderate
grep -rnE "node-version|FROM node:|\"node\":|nodejs[0-9]+" .github/ Dockerfile* package.json .nvmrc serverless.y*ml vercel.json 2>/dev/null # no old pins leftThen build the production image and start it: the app boots without native-module errors (NODE_MODULE_VERSION mismatch), key routes respond, background workers start, and TLS calls to external services succeed.
Safety
- Never update only some pins; production and CI must run the same major.
- Never upgrade Node, a framework major and the module system in one change.
- Never skip a failing native module with
--ignore-scriptsor by deleting it; fix or replace it. - Never disable TLS checks or deprecation errors to make the upgrade pass.
- Never auto-commit, push or deploy; never hand-edit the lockfile.
Does it work?
Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.
No reviews yet
People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.
- It worked
- Partly
- It didn't
Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.
Your trail
Files you open will collect here, so you can find them again.
Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.
Now do this for your own.
Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.

