I got a problem with ts-node. How can I fix it?
// In terminal
(node:1776) Warning: To load an ES module, set "type": "module" in the package.json or use the .mjs extension.
(Use `node --trace-warnings ...` to show where the warning was created)
C:dhello.ts:4
export {};
^^^^^^
SyntaxError: Unexpected token 'export'
at wrapSafe (node:internal/modules/cjs/loader:1378:20)
at Module._compile (node:internal/modules/cjs/loader:1428:41)
at Module.m._compile (C:UserslongtAppDataRoamingnpmnode_modulests-nodesrcindex.ts:1618:23)
at Module._extensions..js (node:internal/modules/cjs/loader:1548:10)
at Object.require.extensions.<computed> [as .ts] (C:UserslongtAppDataRoamingnpmnode_modulests-nodesrcindex.ts:1621:12)
at Module.load (node:internal/modules/cjs/loader:1288:32)
at Function.Module._load (node:internal/modules/cjs/loader:1104:12)
at Function.executeUserEntryPoint [as runMain] (node:internal/modules/run_main:174:12)
at phase4 (C:UserslongtAppDataRoamingnpmnode_modulests-nodesrcbin.ts:649:14)
at bootstrap (C:UserslongtAppDataRoamingnpmnode_modulests-nodesrcbin.ts:95:10)
New contributor
Keme2 is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.
2