I'm trying to create an application that depends on Express, but Cpanel just won't install it. I've contacted Namecheap, followed all their instruction and tried all kinds of things, but haven't had any success.
This is my package.json file
{
"name": "server",
"version": "1.0.0",
"main": "app.js",
"scripts": {
"start": "node app.js"
},
"author": "",
"license": "ISC",
"description": "",
"dependencies": {
"axios": "^0.27.2",
"cors": "^2.8.5",
"dotenv": "^16.0.1",
"express": "^4.17.2",
"mysql2": "^2.3.3",
"puppeteer": "^15.3.2"
}
}
After running "npm install" and having no apparent errors, I find this in the stderr.log file:
- Error: Cannot find module 'express'
- Require stack:
- /home/<user>/public_html/api/app.js
- /usr/local/lsws/fcgi-bin/lsnode.js
at Function.Module._resolveFilename (internal/modules/cjs/loader.js:902:15)
at Function.Module._load (internal/modules/cjs/loader.js:746:27)
at Module.require (internal/modules/cjs/loader.js:974:19)
at require (internal/modules/cjs/helpers.js:93:18)
at Object.<anonymous> (/home/<user>/public_html/api/app.js:3:17)
at Module._compile (internal/modules/cjs/loader.js:1085:14)
at Object.Module._extensions..js (internal/modules/cjs/loader.js:1114:10)
at Module.load (internal/modules/cjs/loader.js:950:32)
at Function.Module._load (internal/modules/cjs/loader.js:790:12)
at Module.require (internal/modules/cjs/loader.js:974:19) {
code: 'MODULE_NOT_FOUND',
requireStack: [
'/home/<user>/public_html/api/app.js',
'/usr/local/lsws/fcgi-bin/lsnode.js'
]
}
For some reason Express won't install. I've destroyed the application and tried all over again, but the same problem arises.
Node version is 14.18.3.
I'm hoping someone who knows what's going on can help me.