{"id":27387,"library":"sequelize-cli-typescript","title":"Sequelize CLI TypeScript","description":"A TypeScript-aware CLI for Sequelize that generates TypeScript migration, model, and seed files instead of JavaScript. Version 3.2.0-c is an early release with experimental Sequelize v4 support. Unlike the standard sequelize-cli, this package introduces separate source and compiled paths for migrations (migrations-source-path and migrations-compiled-path) to accommodate TypeScript compilation. Developers must compile migrations before running db:migrate. The CLI provides commands for database creation, migration management, seeding, and model generation. Maintained by the community, it targets Node >=4.","status":"active","version":"3.2.0-c","language":"javascript","source_language":"en","source_url":"git://github.com/douglas-treadwell/sequelize-cli-typescript","tags":["javascript","sequelize","cli","typescript"],"install":[{"cmd":"npm install sequelize-cli-typescript","lang":"bash","label":"npm"},{"cmd":"yarn add sequelize-cli-typescript","lang":"bash","label":"yarn"},{"cmd":"pnpm add sequelize-cli-typescript","lang":"bash","label":"pnpm"}],"dependencies":[{"reason":"Peer dependency for ORM functionality","package":"sequelize","optional":true}],"imports":[{"note":"This package is a separate fork; standard sequelize-cli generates JS files.","wrong":"npm install -g sequelize-cli","symbol":"sequelize-cli-typescript","correct":"npm install -g sequelize-cli-typescript"},{"note":"No special flag needed; expects compiled JS in the configured compiled path.","wrong":"npx sequelize db:migrate --compiled","symbol":"db:migrate","correct":"npx sequelize db:migrate"},{"note":"Outputs a .ts file for the model and .ts file for migration.","wrong":"node_modules/.bin/sequelize model:generate --name User --attributes name:string,email:string","symbol":"model:generate","correct":"npx sequelize model:generate --name User --attributes name:string,email:string"}],"quickstart":{"code":"npm install --save sequelize-cli-typescript\nnpx sequelize init\n# Edit .sequelizerc to set migrations-source-path and migrations-compiled-path\nnpx sequelize model:generate --name User --attributes name:string,email:string\n# Compile TypeScript migrations (e.g., tsc)\n# Then run migrations\nnpx sequelize db:migrate","lang":"typescript","description":"Initialize project, generate a TypeScript model and migration, compile, and run migrations."},"warnings":[{"fix":"Add a compile step (e.g., tsc) to your workflow, and ensure the compiled output goes to migrations-compiled-path.","message":"Migration files are generated as TypeScript, not JavaScript. You MUST compile them before running db:migrate.","severity":"breaking","affected_versions":">=3.0.0"},{"fix":"Set both paths in .sequelizerc to avoid confusion. Example: migrations-source-path: './migrations', migrations-compiled-path: './migrations-compiled'.","message":"The CLI uses two separate paths: migrations-source-path (source .ts) and migrations-compiled-path (compiled .js). If not configured, defaults may conflict with standard sequelize-cli expectations.","severity":"gotcha","affected_versions":">=3.0.0"},{"fix":"Use with Sequelize v3 for full support, or test thoroughly with v4.","message":"Sequelize v4 support is still experimental in this version (3.2.0-c).","severity":"deprecated","affected_versions":"=3.2.0-c"},{"fix":"Uninstall sequelize-cli if you intend to use sequelize-cli-typescript, or use npx to avoid global conflicts.","message":"The package is named 'sequelize-cli-typescript' on npm, but the CLI binary is still called 'sequelize'. This can cause confusion if both sequelize-cli and sequelize-cli-typescript are installed globally.","severity":"gotcha","affected_versions":">=0.0.0"}],"env_vars":null,"last_verified":"2026-04-25T00:00:00.000Z","next_check":"2026-07-24T00:00:00.000Z","problems":[{"fix":"Reinstall locally: npm install --save sequelize-cli-typescript. Use npx sequelize to run.","cause":"Missing or incorrect installation; global vs local mismatch.","error":"Error: Cannot find module '../node_modules/sequelize-cli-typescript/lib/commands'"},{"fix":"Compile migrations using TypeScript compiler (tsc) and ensure output goes to migrations-compiled-path.","cause":"Migrations are TypeScript files, not compiled to JS in the expected compiled path.","error":"No migrations to run."},{"fix":"Install the appropriate dialect package: npm install --save pg pg-hstore (for PostgreSQL), mysql2 (for MySQL), sqlite3 (for SQLite), or tedious (for MSSQL).","cause":"Missing database driver for the configured dialect.","error":"dialect dependency not found"}],"ecosystem":"npm","meta_description":null,"install_score":null,"install_tag":null,"quickstart_score":null,"quickstart_tag":null}