Node.js Commands
JavaScript runtime built on V8.All Node.js pages
- node --check file.js: check JavaScript syntax without running itnode --check file.js parses a file and reports syntax errors without running it, exit code 0 or 1. What it catches, ES module rules and checking many files.
- node --max-old-space-size=4096: increase the Node.js heap memory limitnode --max-old-space-size=4096 raises the V8 heap limit to fix JavaScript heap out of memory. Set it via NODE_OPTIONS for npm, Docker and CI, and check it.
- node --run build: run a package.json script without npmnode --run build runs a package.json script without starting npm. It skips pre/post scripts and sets NODE_RUN_SCRIPT_NAME; how it compares with npm run.
- node app.ts: run a TypeScript file directly with Node.jsnode app.ts runs TypeScript directly on Node.js 22.18+ by stripping types, with no type check. Which syntax works, enums and the import rules you must follow.