Using Sequelize CLI with the ESM package

Stack Overflow Asked by wdGelwix on January 3, 2022

Is there a way to execute Sequelize migrations with the ESM package? It requires the -r esm command line argument to be passed, but I don’t seem to find that in their docs

One Answer

I had the same issue and the way I got around it is by calling sequelize-cli from the node_modules folder.

In my package.json

    "scripts": {
        "migrate": "node --require esm ./node_modules/.bin/sequelize-cli db:migrate"

then if you run npm run migrate it should work with es6 imports.

Answered by Abir Taheer on January 3, 2022

Add your own answers!

Related Questions

SQL Query [Count the result of a query]

0  Asked on February 3, 2021 by abdelhalim


function stops when fetch() fails

2  Asked on February 2, 2021 by uncannyorange


merging lists of dataframes in R effectively

1  Asked on February 2, 2021 by user5813583


The Math behind a tesorflow.tensordot()

0  Asked on February 1, 2021 by harsh-dhamecha


How to check if a word contains one letter from another string

3  Asked on February 1, 2021 by umar-zahid


How to use citeproc-java on Android

1  Asked on February 1, 2021 by hector


Laravel whereHas Filter sub relation

1  Asked on February 1, 2021 by bryant-tang


How to check if list contains dict element with same key

1  Asked on February 1, 2021 by radosaw-hryniewicki


react-navigation nested drawer items

1  Asked on February 1, 2021 by caner-akmak


Add a header to an outgoing request by a filter in WebFlux

1  Asked on February 1, 2021 by jae-young-lee


Ask a Question

Get help from others!

© 2023 All rights reserved. Sites we Love: PCI Database, UKBizDB, Menu Kuliner, Sharing RPP