Issue
I cloned my repo but while doing "node server" its throwing this error. I already tried reinstalling the packages.
I don't know if its a bug with ec2. Please somebody help me out.
node:internal/modules/cjs/loader:936
throw err;
^
Error: Cannot find module './Routes/VendorSignin/VendorSignin.js'
Require stack:
- /home/ec2-user/specialo/specialo/server/server.js
at Function.Module._resolveFilename (node:internal/modules/cjs/loader:933:15)
at Function.Module._load (node:internal/modules/cjs/loader:778:27)
at Module.require (node:internal/modules/cjs/loader:1005:19)
at require (node:internal/modules/cjs/helpers:102:18)
at Object.<anonymous> (/home/ec2-user/specialo/specialo/server/server.js:10:22)
at Module._compile (node:internal/modules/cjs/loader:1105:14)
at Object.Module._extensions..js (node:internal/modules/cjs/loader:1159:10)
at Module.load (node:internal/modules/cjs/loader:981:32)
at Function.Module._load (node:internal/modules/cjs/loader:822:12)
at Function.executeUserEntryPoint [as runMain] (node:internal/modules/run_main:77:12)
at node:internal/main/run_main_module:17:47 {
code: 'MODULE_NOT_FOUND',
requireStack: [ '/home/ec2-user/specialo/specialo/server/server.js' ]
Solution
I found the solution. I changed all the server folder name from uppercase to lowercase.
For example: VendorSignin to vendor_signin
and it worked!! This is a weird bug so please always keep your server files in lowercase!!
Answered By - brohxa Answer Checked By - Pedro (WPSolving Volunteer)