As I work on developing a REST API using Express in Typescript, I have encountered a perplexing issue with the Typescript Compiler. When I compile the project locally on my Windows 10 machine using tsc -b
, everything goes smoothly. However, when I attempt the same command on an Amazon EC2 instance with the exact same project, nothing seems to happen. There are no visible errors and the console remains inactive until I terminate the process with CTRL+C. Interestingly, I can compile individual files located in the root of the project by running tsc index.ts
, but only if they are positioned directly in the root folder. My tsconfig setup is as follows:
{
"compilerOptions": {
"lib": [
"es5",
"es6"
],
"target": "es5",
"module": "commonjs",
"moduleResolution": "node",
"outDir": "./build",
"emitDecoratorMetadata": true,
"experimentalDecorators": true,
"sourceMap": true,
"esModuleInterop": true
}
}
The project structure consists of:
package.json
package-lock.json
tsconfig.json
src/
app.ts
index.ts
routes/
entity/
The npm version on the Amazon EC2 Instance is 7.8.0.
The Typescript version on the Amazon EC2 Instance is 4.2.4.