-
-
Notifications
You must be signed in to change notification settings - Fork 528
Description
When installing sequelize-cli globally with npm i sequelize-cli -g (so you can actually run sequelize in the terminal) the parts of it which make actual database calls such as those in db:migrate cannot be used.
This is because these db calls require a database client library (sqlite3, mysql, pg, mariasql) to be installed. Normally sequelize expects that the app installing sequelize would install that package so it would have access to it. However when sequelize-cli is global it doesn't have access to the local packages and so there are no database libraries.
There are 4 ways we could fix this:
A) Just install all the database libraries directly into sequelize-cli.
B) Add another command to sequelize-cli that allows npm i to be called to install individual database libraries into the global sequelize-cli.
C) Resolve database libraries from cwd instead of from the global package (there are libraries that can do this; however since sequelize itself is responsible for requiring the packages this may requiring hacking around in either sequelize-cli or sequelize).
D) Drop sequelize from sequelize-cli and instead resolve it from cwd, where it will have access to the locally installed database libraries.