Use the --esm
switch for ts-node.
Eg
ts-node --esm index.ts
This requires you to have the module to set to one of the newer ones (like nodenext
or node16
) and moduleResolution also set to a newer method, in your tsconfig.
Use the --esm
switch for ts-node.
Eg
ts-node --esm index.ts
This requires you to have the module to set to one of the newer ones (like nodenext
or node16
) and moduleResolution also set to a newer method, in your tsconfig.