Registry / type-stubs / sequelize-cli-typescript

sequelize-cli-typescript

JSON →
library3.2.0-cjsnpmunverified

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.

npm install sequelize-cli-typescript
INSTALL
IMPORT
SIG · SEQUELIZE-CLI-TYPE
S
sequelize-cli-typescript
type-stubsjavascriptv3.2.0-c
harness data pending
Install & Compatibility
Where this runs

No compatibility data collected yet for this library.

Code
Verified usage

Verified import paths — ran on the pinned version, not inferred.

sequelize-cli-typescript
npm install -g sequelize-cli-typescript
npm install -g sequelize-cli
This package is a separate fork; standard sequelize-cli generates JS files.
db:migrate
npx sequelize db:migrate
npx sequelize db:migrate --compiled
No special flag needed; expects compiled JS in the configured compiled path.
model:generate
npx sequelize model:generate --name User --attributes name:string,email:string
node_modules/.bin/sequelize model:generate --name User --attributes name:string,email:string
Outputs a .ts file for the model and .ts file for migration.

Initialize project, generate a TypeScript model and migration, compile, and run migrations.

npm install --save sequelize-cli-typescript npx sequelize init # Edit .sequelizerc to set migrations-source-path and migrations-compiled-path npx sequelize model:generate --name User --attributes name:string,email:string # Compile TypeScript migrations (e.g., tsc) # Then run migrations npx sequelize db:migrate
sequelize --version
Debug
Known issues
breakingMigration files are generated as TypeScript, not JavaScript. You MUST compile them before running db:migrate.
fix
Add a compile step (e.g., tsc) to your workflow, and ensure the compiled output goes to migrations-compiled-path.
affects: >=3.0.0
gotchaThe 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.
fix
Set both paths in .sequelizerc to avoid confusion. Example: migrations-source-path: './migrations', migrations-compiled-path: './migrations-compiled'.
affects: >=3.0.0
deprecatedSequelize v4 support is still experimental in this version (3.2.0-c).
fix
Use with Sequelize v3 for full support, or test thoroughly with v4.
affects: =3.2.0-c
gotchaThe 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.
fix
Uninstall sequelize-cli if you intend to use sequelize-cli-typescript, or use npx to avoid global conflicts.
affects: >=0.0.0
Errors
Common errors & fixes
Error: Cannot find module '../node_modules/sequelize-cli-typescript/lib/commands'
Missing or incorrect installation; global vs local mismatch.
fix
Reinstall locally: npm install --save sequelize-cli-typescript. Use npx sequelize to run.
No migrations to run.
Migrations are TypeScript files, not compiled to JS in the expected compiled path.
fix
Compile migrations using TypeScript compiler (tsc) and ensure output goes to migrations-compiled-path.
dialect dependency not found
Missing database driver for the configured dialect.
fix
Install the appropriate dialect package: npm install --save pg pg-hstore (for PostgreSQL), mysql2 (for MySQL), sqlite3 (for SQLite), or tedious (for MSSQL).
Upgrade
Version history
3.2.0-clatest on npm
Audit
Dependencies
sequelizeoptionalPeer dependency for ORM functionality
Agent activity
31 hits · last 30 days
node
28
Meta
1
OpenAI (training)
1
Resources
sequelize-cli-typescript — npm install sequelize-cli-typescript · libregistry