Error with node.js
DanielGolan-mc opened this issue · 5 comments
DanielGolan-mc commented
Error code:
{
"error": {
"message": "Must use import to load ES Module: /opt/node_modules/node-fetch/src/index.js\nrequire() of ES modules is not supported.\nrequire() of /opt/node_modules/node-fetch/src/index.js from /opt/node_modules/dlist.js/dist/client/RestManager.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.\nInstead rename index.js to end in .cjs, change the requiring code to use import(), or remove \"type\": \"module\" from /opt/node_modules/node-fetch/package.json.\n",
"stack": "Error [ERR_REQUIRE_ESM]: Must use import to load ES Module: /opt/node_modules/node-fetch/src/index.js\nrequire() of ES modules is not supported.\nrequire() of /opt/node_modules/node-fetch/src/index.js from /opt/node_modules/dlist.js/dist/client/RestManager.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.\nInstead rename index.js to end in .cjs, change the requiring code to use import(), or remove \"type\": \"module\" from /opt/node_modules/node-fetch/package.json.\n\n at new NodeError (internal/errors.js:322:7)"
}
}
Luna-devv commented
I've fixed this issue in dlist.js@0.4.1
!
Please note that you will have to use node-fetch@2
if you run bellow node.js v18
DanielGolan-mc commented
Tnx! Will use.
DanielGolan-mc commented
I've fixed this issue in
dlist.js@0.4.1
! Please note that you will have to usenode-fetch@2
if you run bellow node.js v18
y'mean version 2?
Luna-devv commented
@DanielGolan-mc you will have to use node-fetch@2
(version 2) since all version above don’t support the way I have to import the module
DanielGolan-mc commented
@DanielGolan-mc you will have to use
node-fetch@2
(version 2) since all version above don’t support the way I have to import the module
oh ok tnx