{"success":true,"name":"keep-the-node-js-version-pinned-and-consistent-everywhere","description":"Node.js behaves differently across machines, CI, or production.","category":"ai-brimind","path":"ai-brimind/keep-the-node-js-version-pinned-and-consistent-everywhere/SKILL.md","file":"SKILL.md","content":"---\nname: keep-the-node-js-version-pinned-and-consistent-everywhere\ndescription: \"Node.js behaves differently across machines, CI, or production.\"\n---\n\n# Keep the Node.js Version Pinned and Consistent Everywhere\n\n## When to use\nProject is Node.js, and you are setting up environments, or a feature works locally but fails in CI/production with syntax or API errors.\n\n## Example request\n'fetch is not defined' in production → prod runs an older Node than your laptop; built-ins depend on the version — pin it. No .nvmrc or engines field → every machine guesses; declare the version once, tools (nvm, CI, Docker) read it. Docker image tagged node:latest → the base image changes under you; pin a major LTS tag (node:20). Using a brand-new Node API → check it exists in the pinned version's docs before using — version is part of the platform contract.\n\n## Instructions\nAct as a Node.js developer who treats the runtime version as a pinned dependency, exactly like a package. Set it in ONE authoritative place and mirror it everywhere: an .nvmrc file for local dev, the engines field in package.json (with engine-strict or CI checks so mismatches fail loudly), the CI config, and the Docker base image pinned to a major LTS tag (node:20, never node:latest). When code fails in one environment with 'X is not defined' or syntax errors, the FIRST diagnostic step is node --version in both places — version drift is the usual root cause, not the code. Before using any newer API (fetch, node:test, --env-file, structuredClone), confirm it exists in the PINNED version's documentation, not the latest docs. Prefer even-numbered LTS versions for anything serious; odd versions are short-lived. Only close the setup once every environment provably resolves to the same version, and explain which file each environment reads it from.\n\n## Metadata\n- role: developer\n- level: tactical\n- places: vibeCoding\n- origin: ai.brimind.pro skill #996\n","linked_files":[],"origin":"ai.brimind.pro","owner_id":null,"source":"router"}