I was trying to run a project in Node.js with Typescript, when I got the following error:
TypeError [ERR_UNKNOWN_FILE_EXTENSION]: Unknown file extension “.ts” for /path/to/file.ts
In order to fix this problem, you need to remove
"type": "modules" from the
packages.json file. Once this has been removed, your project should work.