Why can't i host nodje js with typeScript on render

i can’'t host my nodje.js with type script backend always showing error



==> Cloning from https://github.com/sinanptm/AVM-CARE

Sep 2 01:19:55 PM==> Checking out commit 65b5b859df5956b1d9f478ad4bd568b0cd3f6c13 in branch main

Sep 2 01:19:58 PM==> Using Node version 20.15.1 (default)

Sep 2 01:19:59 PM==> Docs on specifying a Node version: https://render.com/docs/node-version

Sep 2 01:20:01 PM==> Using Bun version 1.1.0 (default)

Sep 2 01:20:01 PM==> Docs on specifying a bun version: https://render.com/docs/bun-version

Sep 2 01:20:01 PM==> Running build command 'npm run build'...

Sep 2 01:20:01 PM

Sep 2 01:20:01 PM> server@1.0.0 build

Sep 2 01:20:01 PM> tsc

Sep 2 01:20:01 PM

Sep 2 01:20:03 PMsrc/config/connectDB.ts(1,25): error TS2307: Cannot find module 'mongoose' or its corresponding type declarations.

Sep 2 01:20:03 PMsrc/config/connectDB.ts(5,24): error TS2580: Cannot find name 'process'. Do you need to install type definitions for node? Try `npm i --save-dev @types/node`.

Sep 2 01:20:03 PMsrc/index.ts(1,21): error TS2307: Cannot find module 'express' or its corresponding type declarations.

Sep 2 01:20:03 PMsrc/index.ts(2,20): error TS2307: Cannot find module 'dotenv' or its corresponding type declarations.

Sep 2 01:20:03 PMsrc/index.ts(5,18): error TS2307: Cannot find module 'cors' or its corresponding type declarations.

Sep 2 01:20:03 PMsrc/index.ts(6,26): error TS2307: Cannot find module 'cookie-parser' or its corresponding type declarations.

Sep 2 01:20:03 PMsrc/index.ts(10,14): error TS2580: Cannot find name 'process'. Do you need to install type definitions for node? Try `npm i --save-dev @types/node`.

Sep 2 01:20:03 PMsrc/index.ts(16,15): error TS2580: Cannot find name 'process'. Do you need to install type definitions for node? Try `npm i --save-dev @types/node`.

Sep 2 01:20:03 PMsrc/index.ts(29,11): error TS2580: Cannot find name 'process'. Do you need to install type definitions for node? Try `npm i --save-dev @types/node`.

Sep 2 01:20:03 PMsrc/infrastructure/database/isValidObjId.ts(1,22): error TS2307: Cannot find module 'mongoose' or its corresponding type declarations.

Sep 2 01:20:03 PMsrc/infrastructure/database/models/OtpModel.ts(1,31): error TS2307: Cannot find module 'mongoose' or its corresponding type declarations.

Sep 2 01:20:03 PMsrc/infrastructure/database/models/PatientModel.ts(1,31): error TS2307: Cannot find module 'mongoose' or its corresponding type declarations.

Sep 2 01:20:03 PMsrc/infrastructure/services/EmailService.ts(2,24): error TS2307: Cannot find module 'nodemailer' or its corresponding type declarations.

Sep 2 01:20:03 PMsrc/infrastructure/services/EmailService.ts(3,27): error TS2307: Cannot find module 'util' or its corresponding type declarations.

Sep 2 01:20:03 PMsrc/infrastructure/services/EmailService.ts(4,16): error TS2307: Cannot find module 'fs' or its corresponding type declarations.

Sep 2 01:20:03 PMsrc/infrastructure/services/EmailService.ts(5,18): error TS2307: Cannot find module 'path' or its corresponding type declarations.

Sep 2 01:20:03 PMsrc/infrastructure/services/EmailService.ts(11,56): error TS2304: Cannot find name '__dirname'.

Hi there,

Are you building your services with NODE_ENV set to production? If the Typescript types are in your devDependecies, they will not be installed as part of your build.

Regards,

Keith
Render Support, UTC+10 :australia:

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.