Using the following command worked for me with node v14.16.1:
node --loader ts-node/esm --experimental-specifier-resolution=node index.ts
There is a warning telling me that --experimental-loader
is an experimental feature but I don’t care because I only use it to debug the typescript code.