Error: Cannot find module '/opt/render/project/src/index.js' on render

I am having an issue with deploying my app on render when I try to make my deployment I am met with this error

and I don’t know how to work my way around it

{
“name”: “food_order_backend”,
“version”: “1.0.0”,
“main”: “index.js”,
“scripts”: {
“start”: “node ./dist/index.js”,
“build”: “tsc -p .”,
“postinstall”: “npm run build”
},
my start is at node./dist/index.js but the file structure is not being seen

machiavelli@oghenes-Air Food_Order_Backend % npm run build && ls dist

food_order_backend@1.0.0 build
tsc -p .

config dto index.js.map models services
controller index.js middlewares routes utility

using this command to check the logs of my file structure how do I move forward
my github link : GitHub - machiavellai/Order-Backend

Hi there,

From the screenshot, it looks like your start command is set to node index.js. Try changing that to npm start so it will pick up the correct path to your startup file. Either that, or update the start command directly to reflect what’s in your package.json file.

Let us know if you have any further questions.

Regards,
Mike


Render Support Engineer, MT (UTC-6, UTC-7 in Winter)

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