question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Node 13.x is not supported

See original GitHub issue

What you are doing?

Nodejs 13.x enable esm module by default https://nodejs.org/api/esm.html

> npx sequelize --options-path ./.sequelizerc.js db:migrate:undo:all && npx sequelize --options-path ./.sequelizerc.js db:migrate

Must use import to load ES Module: d:\...\.sequelizerc.js
require() of ES modules is not supported.
require() of d:\...\.sequelizerc.js from d:\...\node_modules\sequelize-cli\lib\core\yargs.js is an ES module file as it is a .js file whose nearest parent package.json contains "type": "module" which defines all .js files in that package scope as ES modules.
Instead rename .sequelizerc.js to end in .cjs, change the requiring code to use import(), or remove "type": "module" from d:\...\package.json.

So I rename .sequelizerc.js to .sequelizerc.cjs and change all migration files extension to .cjs and get:

File: 00001-MyModel-createTable.cjs does not match pattern: /\.js$/

What do you expect to happen?

Do not force cjs module, things should just work with esm modules.

What is actually happening?

esm modules are not supported

Issue Analytics

  • State:closed
  • Created 4 years ago
  • Reactions:10
  • Comments:8

github_iconTop GitHub Comments

5reactions
al-mahicommented, May 12, 2021

Is there any fix for this issue so far. Having similar issue while running the command npx sequelize db:migrate. Using Node 14 with “sequelize”: “^6.6.2”,“sequelize-cli”: “^6.2.0”

1reaction
madmoizocommented, Jan 17, 2020

Node 8 is end of life so Node 10 is the current active LTS and dynamic import was introduced in Node 9.7. So with a major version bump, it could be possible to just replace require() by import()

Read more comments on GitHub >

github_iconTop Results From Across the Web

Node 13 is not support because of dep of uuid 8 #4991 - GitHub
I use v13 just because when I install node, it is the latest stable version. I think not every one alway upgrade their...
Read more >
javascript - Warning message from npm after installing node v13
Nodejs version you have installed v13.0.0 doesn't support npm. With new npm releases you will able to use node using npm.
Read more >
Update the Node.js agent | New Relic Documentation
js 12 and 13 are not supported by v9. Customers running Node.js 13 and earlier have two options: Upgrade to a supported version...
Read more >
Security updates to all supported release lines on or shortly ...
All supported versions (10.x, 12.x, and 14.x) of Node.js are vulnerable. Note that 13.x will be end-of-life on June 1st, before the security...
Read more >
ts-node - npm
This error is thrown by node when a module is require() d, but node believes it should execute as native ESM. This can...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found