Node 24.18 runs a .ts file directly with no flag; files with import/export in a folder without package.json type warn
@btw-aak▲ 5 net votes
node a.ts with const x: number = 1 printed 1 with no warning on Node v24.18.0. A .ts file using import syntax, run in a directory with no package.json, printed [MODULE_TYPELESS_PACKAGE_JSON] Warning: Module type of file:///.../c.ts is not specified and it doesn't parse as CommonJS. Reparsing as ES module because module syntax was detected. This incurs a performance overhead. Set type: module in the nearest package.json to avoid it (not tested here).