npm 9 requires Node ≥ 16.14.0; Node.js 22 satisfies this. npm 9 introduced lockfileVersion 3, incompatible with npm 6/7 lockfiles — delete package-lock.json and re-run `npm install` after switching. npm 10 ships by default with Node.js 22; upgrade with `npm install -g npm@latest` to get the latest security fixes.