Please install mysql2 package manually
See original GitHub issueWhat are you doing?
when I run ‘node app.js’ ,throw error ‘new Error(‘Please install mysql2 package manually’);’ but i’m installed mysql2. my local client haven’t this problem, just my ubuntu 14 server have it.
You must set the NODE_ENV environment variable
/home/www/test/tougao-server/node_modules/_sequelize@4.37.10@sequelize/lib/dialects/mysql/connection-manager.js:38
throw new Error('Please install mysql2 package manually');
^
Error: Please install mysql2 package manually
at new ConnectionManager (/home/www/test/tougao-server/node_modules/_sequelize@4.37.10@sequelize/lib/dialects/mysql/connection-manager.js:38:15)
at new MysqlDialect (/home/www/test/tougao-server/node_modules/_sequelize@4.37.10@sequelize/lib/dialects/mysql/index.js:14:30)
at new Sequelize (/home/www/test/tougao-server/node_modules/_sequelize@4.37.10@sequelize/lib/sequelize.js:239:20)
at Object.<anonymous> (/home/www/test/tougao-server/controllers/adController.js:3:19)
at Module._compile (internal/modules/cjs/loader.js:678:30)
at Object.Module._extensions..js (internal/modules/cjs/loader.js:689:10)
at Module.load (internal/modules/cjs/loader.js:589:32)
at tryModuleLoad (internal/modules/cjs/loader.js:528:12)
at Function.Module._load (internal/modules/cjs/loader.js:520:3)
at Module.require (internal/modules/cjs/loader.js:626:17)
at require (internal/modules/cjs/helpers.js:20:18)
at Object.<anonymous> (/home/www/test/tougao-server/router/ad.js:2:20)
at Module._compile (internal/modules/cjs/loader.js:678:30)
at Object.Module._extensions..js (internal/modules/cjs/loader.js:689:10)
at Module.load (internal/modules/cjs/loader.js:589:32)
at tryModuleLoad (internal/modules/cjs/loader.js:528:12)
at Function.Module._load (internal/modules/cjs/loader.js:520:3)
at Module.require (internal/modules/cjs/loader.js:626:17)
at require (internal/modules/cjs/helpers.js:20:18)
at /home/www/test/tougao-server/router/index.js:37:17
at Array.forEach (<anonymous>)
at Object.<anonymous> (/home/www/test/tougao-server/router/index.js:36:4)
What do you expect to happen?
I wanted Foo!
What is actually happening?
But the output was bar!
Output, either JSON or SQL
Dialect: mysql __Database version:_5.5.60 __Sequelize version: 4.37.10 __Tested with latest release: no
Note : Your issue may be ignored OR closed by maintainers if it’s not tested against latest version OR does not follow issue template.
Issue Analytics
- State:
- Created 5 years ago
- Reactions:6
- Comments:18 (2 by maintainers)
Top Results From Across the Web
ERROR: Please install mysql2 package manually
i installed mysql2 package globally out of my project folder using : npm install mysql2 -g.
Read more >Please install mysql2 package manually in NodeJS Application
Introduction. This is an article where the main focus is to solve an error message. The error appear upon executing a NodeJS application....
Read more >[Solved]-Install mysql2 package manually - error-node.js
For those who have this issue, I solved mine by npm intall -g mysql2 . It happens if you install sequelize-cli globally, it...
Read more >mysql2 - npm
MySQL2 is free from native bindings and can be installed on Linux, Mac OS or Windows without any issues. npm install --save mysql2....
Read more >ERROR: Please install mysql2 package manually (15 answers)
ERROR: Please install mysql2 package manuallyFound it helpful? Subscribe to my youtube channel.
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
@arielrahmane wherever you import sequelize you can set the
dialectModulein the options. Example below.If you’re bundling with Webpack, my workaround for
v5is:The bug is in the code:
require(moduleName)won’t work with Webpack.