node-mysql2 icon indicating copy to clipboard operation
node-mysql2 copied to clipboard

Working Fine on Localhost But crash on Cpanel

Open zoobibackups opened this issue 2 years ago • 3 comments

when i import this statment on the app.js my app crash. const mysql = require('mysql2');

the Package.json

{
  "name": "testApp",
  "version": "1.0.0",
  "private": true,
  "scripts": {
    "start": "node ./app.js",
    "start:dev": "nodemon ./app.js"
  },
  "dependencies": {
    "axios": "^1.4.0",
    "body-parser": "^1.19.0",
    "cookie-parser": "~1.4.4",
    "express": "^4.17.1",
    "joi": "^17.2.1",
    "moment": "^2.29.4",
    "morgan": "~1.9.1",
    "multer": "^1.4.5-lts.1",
    "mysql2": "^3.4.0",
    "node-cron": "^3.0.2",
    "nodemailer": "^6.4.11",
    "rootpath": "^0.1.2",
    "sequelize": "^6.28.0",
    "sequelize-auto": "^0.8.8"
  }
}

i also try const mysql = require("mysql2/promise"); not working

zoobibackups avatar Jun 20 '23 08:06 zoobibackups

can you give a bit more details about the crash? Do you see any error message? Can you paste the stack trace?

sidorares avatar Jun 20 '23 08:06 sidorares

The application process exited prematurely. App 575050 output: at Object. (/home/truecall/nodevenv/public_html/truecaller/10/lib/node_modules/lru-cache/dist/cjs/index-cjs.js:5:36)

zoobibackups avatar Jun 20 '23 08:06 zoobibackups

might be related to #1965 or #1885 but would help to see the full stack ( and error message itself for the original error ) "The application process exited prematurely." is likely coming from some top level handler for process exit event

sidorares avatar Jun 20 '23 09:06 sidorares