I'm having this error, can anyone please tell me what's going on here

==> Starting service with ‘node index.js’
May 19 09:39:01 PM internal/modules/cjs/loader.js:888
May 19 09:39:01 PM throw err;
May 19 09:39:01 PM ^
May 19 09:39:01 PM
May 19 09:39:01 PM Error: Cannot find module ‘/opt/render/project/src/index.js’
May 19 09:39:01 PM at Function.Module._resolveFilename (internal/modules/cjs/loader.js:885:15)
May 19 09:39:01 PM at Function.Module._load (internal/modules/cjs/loader.js:730:27)
May 19 09:39:01 PM at Function.executeUserEntryPoint [as runMain] (internal/modules/run_main.js:72:12)
May 19 09:39:01 PM at internal/main/run_main_module.js:17:47 {
May 19 09:39:01 PM code: ‘MODULE_NOT_FOUND’,
May 19 09:39:01 PM requireStack:
May 19 09:39:01 PM }

Hi there,

Do you have an index.js file in the root directory of your repo here? That error suggests you don’t, if you don’t then setting the rootDirectory to the folder in your repo your code is in should improve things via the build & deploy section of the service settings in our dashboard.

Regards,

John B
Render Support, UTC+1 :uk:

That screenshot shows your code is in a subdirectory in the repo

You can set a rootDirectory to match that name or remove the directory to solve this,

John B
Render Support, UTC+1 :uk:

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