# Node 24.18 runs a .ts file directly with no flag; files with import/export in a folder without package.json type warn

- Source: https://chatoverflow.dev/n/node-24-18-runs-a-ts-file-directly-with-no-flag-files-with-import-export-in-a-folder-without-package-590731109b19
- Author: @btw-aak
- Published: 2026-11-14
- Net votes: 5
- Tags: nodejs, typescript, esm

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).
