Hi Matt, thanks for your response, I changed the settings on render to this:
Root Directory: backend
Build Command: npm install && npm run build
Start Command: npm start
And this the the logs I got:
backend@1.0.0 build
Apr 15 11:25:36 AM> tsc
Apr 15 11:25:36 AM
Apr 15 11:25:40 AMsrc/index.ts(1,1): error TS2580: Cannot find name ‘require’. Do you need to install type definitions for node? Try npm i --save-dev @types/node
.
Apr 15 11:25:40 AMsrc/index.ts(3,21): error TS7016: Could not find a declaration file for module ‘express’. ‘/opt/render/project/src/backend/node_modules/express/index.js’ implicitly has an ‘any’ type.
Apr 15 11:25:40 AM Try npm i --save-dev @types/express
if it exists or add a new declaration (.d.ts) file containing declare module 'express';
Apr 15 11:25:40 AMsrc/index.ts(4,18): error TS7016: Could not find a declaration file for module ‘cors’. ‘/opt/render/project/src/backend/node_modules/cors/lib/index.js’ implicitly has an ‘any’ type.
Apr 15 11:25:40 AM Try npm i --save-dev @types/cors
if it exists or add a new declaration (.d.ts) file containing declare module 'cors';
Apr 15 11:25:40 AMsrc/index.ts(16,16): error TS2580: Cannot find name ‘process’. Do you need to install type definitions for node? Try npm i --save-dev @types/node
.
Apr 15 11:25:40 AMsrc/index.ts(26,38): error TS7006: Parameter ‘req’ implicitly has an ‘any’ type.
Apr 15 11:25:40 AMsrc/index.ts(26,43): error TS7006: Parameter ‘res’ implicitly has an ‘any’ type.
Apr 15 11:25:40 AMsrc/index.ts(45,43): error TS7006: Parameter ‘req’ implicitly has an ‘any’ type.
Apr 15 11:25:40 AMsrc/index.ts(45,48): error TS7006: Parameter ‘res’ implicitly has an ‘any’ type.
Apr 15 11:25:40 AMsrc/index.ts(61,42): error TS7006: Parameter ‘req’ implicitly has an ‘any’ type.
Apr 15 11:25:40 AMsrc/index.ts(61,46): error TS7006: Parameter ‘res’ implicitly has an ‘any’ type.
Apr 15 11:25:40 AMsrc/index.ts(87,41): error TS7006: Parameter ‘req’ implicitly has an ‘any’ type.
Apr 15 11:25:40 AMsrc/index.ts(87,45): error TS7006: Parameter ‘res’ implicitly has an ‘any’ type.
Apr 15 11:25:40 AMsrc/index.ts(108,44): error TS7006: Parameter ‘req’ implicitly has an ‘any’ type.
Apr 15 11:25:40 AMsrc/index.ts(108,48): error TS7006: Parameter ‘res’ implicitly has an ‘any’ type.
Apr 15 11:25:40 AMsrc/recipe-api.ts(2,16): error TS2580: Cannot find name ‘process’. Do you need to install type definitions for node? Try npm i --save-dev @types/node
.
Apr 15 11:25:40 AM==> Build failed
And this is my package.json
{
“name”: “backend”,
“version”: “1.0.0”,
“description”: “”,
“main”: “index.js”,
“scripts”: {
“build”: “tsc”,
“start”: “node build/index.js”
},
“keywords”: ,
“author”: “”,
“license”: “ISC”,
“dependencies”: {
“@prisma/client”: “^5.9.1”,
“cors”: “^2.8.5”,
“dotenv”: “^16.4.5”,
“express”: “^5.0.0-beta.1”,
“prisma”: “^5.9.1”
},
“devDependencies”: {
“@types/cors”: “^2.8.17”,
“@types/express”: “^4.17.21”,
“@types/node”: “^20.11.20”,
“nodemon”: “^3.0.3”,
“ts-node”: “^10.9.2”,
“typescript”: “^5.4.5”
}
}