• Jobs
  • About Us
  • professionals
    • Home
    • Jobs
    • Courses and challenges
  • business
    • Home
    • Post vacancy
    • Our process
    • Pricing
    • Assessments
    • Payroll
    • Blog
    • Sales
    • Salary Calculator

0

257
Views
tsc not compiling all js files

I'm having an issue compiling all the typescript files + javascript files into javascript files. it's not compiling all the javascript files to the dist folder.

here is the command I run: rm -rf ./dist && tsc -p . && node ./dist/server.js

and I get this error: Unhandled rejection Error: Cannot find module './email-service' then I went to the folder email-service and I can't find the index.js file in there, it wasn't compiled.

here is my tsconfig file:

{
    "compilerOptions": {
        "outDir": "./dist",                    
        "rootDir": ".",                          
        "module": "commonjs",                   
        "target": "es6",                        
        "lib": ["dom", "es6"],                   
        "sourceMap": true,                 
        "checkJs": false,                      
        "allowJs": true,                         
        "moduleResolution": "node",          
        "noEmit": false,                         
        "baseUrl": "./src",                      
        "strict": true,                          
        "esModuleInterop": true,                
        "resolveJsonModule": true,               
        "isolatedModules": true,                  
        "importHelpers": true,                   
        "declaration": true,                      
        "strictPropertyInitialization": false,    
        "alwaysStrict": true,                  
        "paths": {                                
            "~/*": ["*"]
        },
    },
    "include": [ "*.js", "*.ts", "*.json"],      
    "exclude": ["node_modules", "dist"]    
}

node version: 10.16.1

Folder Structure :

.
├── tsconfig.json
├── _src
│   └──_ email-service
│      └── index.js (missing)
├── _dist
│   └──_src
│      └──_ email-service
│         └── index.js


any idea whats the issue?

about 3 years ago · Juan Pablo Isaza
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Our process Sales
Legal
Terms and conditions Privacy policy
© 2025 PeakU Inc. All Rights Reserved.

Andres GPT

Recommend me some offers
I have an error