cli: sequelize db:migrate not working
I create migration as following:
sequelize migration:create --name articles --env development
and then define migrations articles
generated.
Next, type: sequelize db:migrate
Of course, I did configuration database information on config.js
before that. But query return error,i did uninstall sequelize-cli and reinstall but still not working. 😦
I hope, have someone support my issue.
Thanks & Best regards,
Sequelize [Node: 3.2.0, CLI: 1.9.1, ORM: 3.9.0]
Loaded configuration file "config\config.json".
Using environment "development".
Using gulpfile ~\AppData\Roaming\npm\node_modules\sequelize-cli\lib\gulpfile.js
Starting 'db:migrate'...
'db:migrate' errored after 15 ms
at new Sequelize (C:\Users\0xgi\Desktop\node_modules\sequelize\lib\sequelize.js:202:11)
at getSequelizeInstance (C:\Users\0xgi\AppData\Roaming\npm\node_modules\sequelize-cli\lib\tasks\db.js:2
82:10)
at getMigrator (C:\Users\0xgi\AppData\Roaming\npm\node_modules\sequelize-cli\lib\tasks\db.js:287:21)
at Object.module.exports.db:migrate.task (C:\Users\0xgi\AppData\Roaming\npm\node_modules\sequelize-cli\
lib\tasks\db.js:23:7)
at Gulp.gulp.task.aliases (C:\Users\0xgi\AppData\Roaming\npm\node_modules\sequelize-cli\lib\helpers\gul
p-helper.js:14:14)
at module.exports (C:\Users\0xgi\AppData\Roaming\npm\node_modules\sequelize-cli\node_modules\gulp\node_
modules\orchestrator\lib\runTask.js:34:7)
at Gulp.Orchestrator._runTask (C:\Users\0xgi\AppData\Roaming\npm\node_modules\sequelize-cli\node_module
s\gulp\node_modules\orchestrator\index.js:273:3)
at Gulp.Orchestrator._runStep (C:\Users\0xgi\AppData\Roaming\npm\node_modules\sequelize-cli\node_module
s\gulp\node_modules\orchestrator\index.js:214:10)
at Gulp.Orchestrator.start (C:\Users\0xgi\AppData\Roaming\npm\node_modules\sequelize-cli\node_modules\g
ulp\node_modules\orchestrator\index.js:134:8)
at C:\Users\0xgi\AppData\Roaming\npm\node_modules\sequelize-cli\node_modules\gulp\bin\gulp.js:129:20
at doNTCallback0 (node.js:407:9)
at process._tickCallback (node.js:336:13)
at Function.Module.runMain (module.js:473:11)
at startup (node.js:117:18)
at node.js:951:3
About this issue
- Original URL
- State: closed
- Created 9 years ago
- Comments: 21 (12 by maintainers)
I was having the same issue in Windows 10 - 64 bit. I’ve followed @ibunubi 's suggestion and all I did is change line 8 from
var config = require(__dirname + '/..\config\config.json')[env];
tovar config = require(__dirname + '/../config/config.json')[env];
which makes me think it’s a bug for windows users only. Btw this was a brand new installtion of sequelize-cli inside express. Now it works