ts-node cannot find a local file that exists

Viewed 25

I'm just trying to run npx tsc && node dist in the project directory with the following project structure:

project
|--dist
|--node_modules
|--src
|--package.json
|--tsconfig.json
|--...

...and it gives me the following error:

Error: Cannot find module './dist'

I checked the dependencies, ran npm install, and also made sure that the path is correct. Is there anything wrong with my configuration? I honestly have no clue.

The following is my tsconfig.json btw:

{
  "compilerOptions": {
    "composite": true,
    "target": "esnext",
    "module": "esnext",
    "rootDir": "./",
    "strict": true,
    "skipLibCheck": true,
    "outDir": "dist",
    "sourceMap": true,
    "declaration": true
  },
  "include": [
    "src"
  ]
}
0 Answers
Related