Comments (16)
Haha, never mind, this is actually just a horribly unclear error message because the sequelize-cli code defaults to mysql instead of telling you what actually went wrong, to wit, it couldn't find an option.
from cli.
I'm hitting this too and can't (read, don't want to) install mysql. There used to be an option for --config
so you could provide it with the path to the sequelize config, but that seems to be have gone sequelize-cli.
from cli.
will try to fix that during the next week! PRs are welcome though
from cli.
I fixed it locally by doing this:
var helpers = require(__dirname)
, _ = require('lodash')
, _s = require('underscore.string')
, Sequelize = require('sequelize')
, config = helpers.config.readConfig()
var sequelize = new Sequelize(
config.database,
config.username,
config.password,
config
)
However, I don't think that will work with connection URLs?
from cli.
You should be able to pass a connection URL to the constructor (new Sequelize(uri, options)
)
from cli.
Yeah, but I don't want to have to figure out which variant came from the config. I happen to be using a .js file that returns a JSON object, but AFAIK other users may be using connection URLs. I'm just reading config-helper.js now to understand it better. That code is at the top of migration-helper.js, where the bug is, BTW.
from cli.
Ah no, that code should actually fix this. The config-helper parses the URL and canonicalizes to JSON. I'll send a PR.
from cli.
I think it does seem like a clumsy way of converting names though, but it's pragmatic for now in any case.
from cli.
Raised #21. Would be nice to get a release out when it's possible. Or is there some way I can use my fork in the interim, without npm install
clobbering it?
from cli.
You can point your package.json at GH:
{
"sequelize": "sequelize/sequelize#commit-ish"
}
from cli.
their is a fair chance that this issue is fixed with #22.
from cli.
i just released v0.2.4. can you give that a try?
from cli.
Tested, works. Thanks heaps! 👯
from cli.
great!
from cli.
Don't wanna be a party pooper but this just happened for me.
I'll report back with more info on why this happened for me. Running Sequelize-CLI 2.0.0 ...
from cli.
I should mention I'm trying to use postgres, and the relevant part of my config.json is
"development": {
"host": "localhost",
"port": 3002,
"cookieSecret": "cookieSecret",
"sessionSecret": "sessionSecret",
"database": {
"username": "username",
"password": "",
"database": "database",
"host":"localhost",
"port": "5432",
"dialect": "postgres"
},
→ ./node_modules/.bin/sequelize db:migrate
Sequelize [Node: 4.1.1, CLI: 2.0.0, ORM: 3.11.0]
Loaded configuration file "config/config.json".
Using environment "development".
Using gulpfile ~/src/projects/chronos_web/node_modules/sequelize-cli/lib/gulpfile.js
Starting 'db:migrate'...
[Error: The dialect mysql is not supported. (Error: Please install mysql package manually)]
'db:migrate' errored after 26 msError: The dialect mysql is not supported. (Error: Please install mysql package manually)
at new Sequelize (/Users/a206468627/src/projects/chronos_web/node_modules/sequelize/lib/sequelize.js:203:11)
at getSequelizeInstance (/Users/a206468627/src/projects/chronos_web/node_modules/sequelize-cli/lib/tasks/db.js:284:12)
at getMigrator (/Users/a206468627/src/projects/chronos_web/node_modules/sequelize-cli/lib/tasks/db.js:293:21)
at Object.module.exports.db:migrate.task (/Users/a206468627/src/projects/chronos_web/node_modules/sequelize-cli/lib/tasks/db.js:23:7)
at Gulp.gulp.task.aliases (/Users/a206468627/src/projects/chronos_web/node_modules/sequelize-cli/lib/helpers/gulp-helper.js:14:14)
at module.exports (/Users/a206468627/src/projects/chronos_web/node_modules/sequelize-cli/node_modules/gulp/node_modules/orchestrator/lib/runTask.js:34:7)
at Gulp.Orchestrator._runTask (/Users/a206468627/src/projects/chronos_web/node_modules/sequelize-cli/node_modules/gulp/node_modules/orchestrator/index.js:273:3)
at Gulp.Orchestrator._runStep (/Users/a206468627/src/projects/chronos_web/node_modules/sequelize-cli/node_modules/gulp/node_modules/orchestrator/index.js:214:10)
at Gulp.Orchestrator.start (/Users/a206468627/src/projects/chronos_web/node_modules/sequelize-cli/node_modules/gulp/node_modules/orchestrator/index.js:134:8)
at /Users/a206468627/src/projects/chronos_web/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:477:11)
at startup (node.js:117:18)
at node.js:951:3
from cli.
Related Issues (20)
- Error on running db: migrate with Node 18.17.9 HOT 1
- Model.associate adding new columns
- Proposal: Controller Generation in Sequelize
- Tests are stuck HOT 5
- postgres: db:create should not fail if the database does exist
- BulkInsert "relation does not exist" in migration script
- const model = require(path.join(__dirname, file)).default( ^ TypeError: require(...).default is not a function
- const model = require(path.join(__dirname, file)).default( ^ TypeError: require(...).default is not a function HOT 1
- Sequelize CLI Fails to Authenticate with Postgres DB Containing a ':' in Password HOT 3
- CLI is not taking default env like node latest versions have (20.8.0)
- SequelizeMeta structure incompatible with SingleStore/memsql HOT 2
- Problem running migrations with yarn
- When on typescript project, sequelize-cli still generates javascript files. HOT 3
- Running migrations, on Azure database HOT 1
- Seeders state in database with using url option
- Migration undo command didn't work correctly. HOT 1
- where condition in literal HOT 1
- nested dependency es5-ext has a security vulnerability (low) and needs update HOT 1
- Subsequent migrations fail after running db:migrate:schema:timestamps:add command
- Please install sqlite3 package manually
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from cli.