The reason seems to be the use of ES Modules. By the look of things, when ESM are used, ts-node
simply falls back to calling node
, which is why you get these warnings. Disabling esm
in the ts-node
config and changing the type
to commonjs
in my "package.json" files helped in my case.
However, this isn't ideal. A quick Google search suggests that ES Modules are the future. At the same time, after taking a quick look at ts-node's code, it seems to be deliberately skipping type checks for ES Modules (https://github.com/TypeStrong/ts-node/blob/main/esm/transpile-only.mjs). So, you either get ES Modules, or type checking - but not both. I'm new to TypeScript and node.js, and would really appreciate a better solution.