Using Node version 14.17.0 (default)
Jun 1 04:23:17 PM ==> Docs on specifying a Node version: Specifying a Node Version | Render
Jun 1 04:23:17 PM ==> Starting service with ‘node backend/server.js’
Jun 1 04:23:19 PM internal/modules/cjs/loader.js:888
Jun 1 04:23:19 PM throw err;
Jun 1 04:23:19 PM ^
Jun 1 04:23:19 PM
Jun 1 04:23:19 PM Error: Cannot find module ‘…/utils/apifeatures’
Jun 1 04:23:19 PM Require stack:
Jun 1 04:23:19 PM - /opt/render/project/src/backend/controllers/productController.js
Jun 1 04:23:19 PM - /opt/render/project/src/backend/routes/productRoute.js
Jun 1 04:23:19 PM - /opt/render/project/src/backend/app.js
Jun 1 04:23:19 PM - /opt/render/project/src/backend/server.js
Jun 1 04:23:19 PM at Function.Module._resolveFilename (internal/modules/cjs/loader.js:885:15)
Jun 1 04:23:19 PM at Function.Module._load (internal/modules/cjs/loader.js:730:27)
Jun 1 04:23:19 PM at Module.require (internal/modules/cjs/loader.js:957:19)
Jun 1 04:23:19 PM at require (internal/modules/cjs/helpers.js:88:18)
Jun 1 04:23:19 PM at Object. (/opt/render/project/src/backend/controllers/productController.js:4:21)
Jun 1 04:23:19 PM at Module._compile (internal/modules/cjs/loader.js:1068:30)
Jun 1 04:23:19 PM at Object.Module._extensions…js (internal/modules/cjs/loader.js:1097:10)
Jun 1 04:23:19 PM at Module.load (internal/modules/cjs/loader.js:933:32)
Jun 1 04:23:19 PM at Function.Module._load (internal/modules/cjs/loader.js:774:14)
Jun 1 04:23:19 PM at Module.require (internal/modules/cjs/loader.js:957:19)
Jun 1 04:23:19 PM at require (internal/modules/cjs/helpers.js:88:18)
Jun 1 04:23:19 PM at Object. (/opt/render/project/src/backend/routes/productRoute.js:12:5)
Jun 1 04:23:19 PM at Module._compile (internal/modules/cjs/loader.js:1068:30)
Jun 1 04:23:19 PM at Object.Module._extensions…js (internal/modules/cjs/loader.js:1097:10)
Jun 1 04:23:19 PM at Module.load (internal/modules/cjs/loader.js:933:32)
Jun 1 04:23:19 PM at Function.Module._load (internal/modules/cjs/loader.js:774:14) {
Jun 1 04:23:19 PM code: ‘MODULE_NOT_FOUND’,
Jun 1 04:23:19 PM requireStack: [
Jun 1 04:23:19 PM ‘/opt/render/project/src/backend/controllers/productController.js’,
Jun 1 04:23:19 PM ‘/opt/render/project/src/backend/routes/productRoute.js’,
Jun 1 04:23:19 PM ‘/opt/render/project/src/backend/app.js’,
Jun 1 04:23:19 PM ‘/opt/render/project/src/backend/server.js’
Jun 1 04:23:19 PM ]
Jun 1 04:23:19 PM }
Jun 1 04:23:42 PM ==> Using Node version 14.17.0 (default)
Jun 1 04:23:42 PM ==> Docs on specifying a Node version: Specifying a Node Version | Render
Jun 1 04:23:42 PM ==> Starting service with ‘node backend/server.js’
Jun 1 04:23:44 PM internal/modules/cjs/loader.js:888
Jun 1 04:23:44 PM throw err;
Jun 1 04:23:44 PM ^
Jun 1 04:23:44 PM
Jun 1 04:23:44 PM Error: Cannot find module ‘…/utils/apifeatures’
Jun 1 04:23:44 PM Require stack:
Jun 1 04:23:44 PM - /opt/render/project/src/backend/controllers/productController.js
Jun 1 04:23:44 PM - /opt/render/project/src/backend/routes/productRoute.js
Jun 1 04:23:44 PM - /opt/render/project/src/backend/app.js
Jun 1 04:23:44 PM - /opt/render/project/src/backend/server.js
Jun 1 04:23:44 PM at Function.Module._resolveFilename (internal/modules/cjs/loader.js:885:15)
Jun 1 04:23:44 PM at Function.Module._load (internal/modules/cjs/loader.js:730:27)
Jun 1 04:23:44 PM at Module.require (internal/modules/cjs/loader.js:957:19)
Jun 1 04:23:44 PM at require (internal/modules/cjs/helpers.js:88:18)
Jun 1 04:23:44 PM at Object. (/opt/render/project/src/backend/controllers/productController.js:4:21)
Jun 1 04:23:44 PM at Module._compile (internal/modules/cjs/loader.js:1068:30)
Jun 1 04:23:44 PM at Object.Module._extensions…js (internal/modules/cjs/loader.js:1097:10)
Jun 1 04:23:44 PM at Module.load (internal/modules/cjs/loader.js:933:32)
Jun 1 04:23:44 PM at Function.Module._load (internal/modules/cjs/loader.js:774:14)
Jun 1 04:23:44 PM at Module.require (internal/modules/cjs/loader.js:957:19)
Jun 1 04:23:44 PM at require (internal/modules/cjs/helpers.js:88:18)
Jun 1 04:23:44 PM at Object. (/opt/render/project/src/backend/routes/productRoute.js:12:5)
Jun 1 04:23:44 PM at Module._compile (internal/modules/cjs/loader.js:1068:30)
Jun 1 04:23:44 PM at Object.Module._extensions…js (internal/modules/cjs/loader.js:1097:10)
Jun 1 04:23:44 PM at Module.load (internal/modules/cjs/loader.js:933:32)
Jun 1 04:23:44 PM at Function.Module._load (internal/modules/cjs/loader.js:774:14) {
Jun 1 04:23:44 PM code: ‘MODULE_NOT_FOUND’,
Jun 1 04:23:44 PM requireStack: [
Jun 1 04:23:44 PM ‘/opt/render/project/src/backend/controllers/productController.js’,
Jun 1 04:23:44 PM ‘/opt/render/project/src/backend/routes/productRoute.js’,
Jun 1 04:23:44 PM ‘/opt/render/project/src/backend/app.js’,
Jun 1 04:23:44 PM ‘/opt/render/project/src/backend/server.js’
Jun 1 04:23:44 PM ]
Jun 1 04:23:44 PM }
HI,
I suspect this may be a casing issue.
Linux has a case-sensitive filesystem, so the file references in your code need to match the file paths exactly.
For example, the error you shared shows:
Error: Cannot find module ‘.../utils/apifeatures’
If that path in your repo is actually something like:
.../Utils/APIFeatures’
it wouldn’t be found as the casing is different.
Hope that helps
Alan
This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.