Node 13.x is not supported
See original GitHub issueWhat 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:
- Created 4 years ago
- Reactions:10
- Comments:8
Top 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 >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
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”
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()
byimport()