Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

615
Views
No se puede encontrar el módulo 'secuencia/tipos'

alguien sabe por qué recibo este error, este es mi código

 "use strict"; const { DataTypes } = require("sequelize/types"); module.exports = { up: async (queryInterface, DataTypes) => { await queryInterface.createTable("dummytables", { id: { allowNull: false, autoIncrement: true, primaryKey: true, type: DataTypes.INTEGER, }, id: { type: DataTypes.NUMBER, }, first_name: { type: DataTypes.STRING, allowNull: false, }, last_name: { type: DataTypes.STRING, allowNull: false, }, }); }, down: async (queryInterface, DataTypes) => { await queryInterface.dropTable("dummytables"); }, };

cuando intento ejecutar este comando sequelize db:migrate y me muestra ERROR: Cannot find module 'sequelize/types'

mi archivo de dependencias

 "dependencies": { "@types/sequelize": "^4.28.9", "express": "^4.17.1", "mysql2": "^2.2.5", "sequelize": "^6.5.0", "sequelize-cli": "^6.2.0" }

cualquier solución necesita ayuda

over 4 years ago · Santiago Trujillo
3 answers
Answer question

0

"use strict"; //const { DataTypes } = require("sequelize/types"); // Remove this line module.exports = { up: async (queryInterface, DataTypes) => { await queryInterface.createTable("dummytables", { id: { allowNull: false, autoIncrement: true, primaryKey: true, type: DataTypes.INTEGER, }, id: { type: DataTypes.NUMBER, }, first_name: { type: DataTypes.STRING, allowNull: false, }, last_name: { type: DataTypes.STRING, allowNull: false, }, }); }, down: async (queryInterface, DataTypes) => { await queryInterface.dropTable("dummytables"); }, };
over 4 years ago · Santiago Trujillo Report

0

Si cambia la segunda línea a;

 const { DataTypes } = require("sequelize");

Debería funcionar bien.

over 4 years ago · Santiago Trujillo Report

0

Una mejor solución sería simplemente instalar Sequelize como;

const Sequelize = require("sequelize");

entonces úsalo como;

 first_name: { type: Sequelize.STRING, allowNull: false, },

Es posible que ni siquiera necesite hacer la importación porque up() se lo daría gratis, solo necesita reemplazar DataTypes con Sequelize .

 async up(queryInterface, Sequelize) { ... }
over 4 years ago · Santiago Trujillo Report
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!