To load an ES module, set “type”: “module” in the package.json or use the .mjs extension

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.

Leave a Comment

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)