0

I am trying to set up nodejs project on Hostgator. But while setting up I am getting the below error. Any help would be really appreciated. My node version is 16.8.0 and the npm version is 7.21.0

 /home/dir/project_folder/node_modules/mysql2/lib/packets/index.js:49
Object.entries(ctorMap).forEach(([name, ctor]) => {
       ^

TypeError: Object.entries is not a function
    at Object.<anonymous> (/home/dir/project_folder/node_modules/mysql2/lib/packets/index.js:49:8)
    at Module._compile (module.js:577:32)
    at Object.Module._extensions..js (module.js:586:10)
    at Module.load (module.js:494:32)
    at tryModuleLoad (module.js:453:12)
    at Function.Module._load (module.js:445:3)
    at Module.require (module.js:504:17)
    at require (internal/module.js:20:19)
    at Object.<anonymous> (/home/dir/project_folder/node_modules/mysql2/lib/connection.js:23:17)
    at Module._compile (module.js:577:32)
Manik Thakur
  • 294
  • 2
  • 15

1 Answers1

0

It is working by replacing node mysql2 with mysql package.

Manik Thakur
  • 294
  • 2
  • 15