I'm attempting to execute a single ES module .ts file within a Next.js project using the default configuration for quick debugging:
npx ts-node lib/my_module.ts
However, I encounter the following error:
Warning: To load an ES module, set "type": "module" in the package.json or use the .mjs extension.
Since I prefer not to modify the default configuration, I am seeking a practical solution to resolve this issue.