Node and npm versions
Check which versions you’re running.
node -v && npm -vnpm, npx and nvm commands for Node.js projects: reinstalling dependencies, checking outdated packages, switching Node versions and scaffolding new apps.
14 commands
Check which versions you’re running.
node -v && npm -vThe classic fix for weird dependency errors.
rm -rf node_modules package-lock.json && npm installRegenerates the lockfile, so versions may change within your semver ranges.
Deletes node_modules and installs exactly what package-lock.json says. Best for CI and reproducible builds.
npm ciCurrent, wanted and latest versions of every dependency.
npm outdatedBumps every version in package.json to the newest release.
npx npm-check-updates -u && npm installIncludes major versions that may have breaking changes. Commit first.
Shows which dependencies pulled it in.
npm explain Everything installed with npm install -g.
npm ls -g --depth=0Fixes some corrupted-download errors.
npm cache clean --forceUpgrades packages with known vulnerabilities where it’s safe to do so.
npm audit fixRequires nvm (or nvm-windows).
nvm install --lts && nvm use --ltsScaffolds a new Next.js project with prompts for TypeScript, ESLint and more.
npx create-next-app@latest Choose React, Vue, Svelte and more.
npm create vite@latest Turns on pnpm using Node’s built-in Corepack.
corepack enable pnpmRun npm run with no name to list available scripts.
npm run Every command copies as plain, clean text: no curly quotes, no long dashes, no invisible characters.