Bug: node-fetch require error
See original GitHub issueBug: I have cloned the repo for the first time, ran npm install, and npm run dev. The following error is presented:
Error [ERR_REQUIRE_ESM]: require() of ES Module /home/jonatan/git/chat-e2ee/node_modules/node-fetch/src/index.js from /home/jonatan/git/chat-e2ee/backend/external/imgbb.js not supported.
Instead change the require of index.js in /home/jonatan/git/chat-e2ee/backend/external/imgbb.js to a dynamic import() which is available in all CommonJS modules.
Steps to Reproduce:
- clone the repository
- run npm install
- run npm run dev
Context: System: Ubuntu 20.04.3 LTS Node version: v16.14.1
Issue Analytics
- State:
- Created 2 years ago
- Comments:5 (5 by maintainers)
Top Results From Across the Web
require('node-fetch') gives ERR_REQUIRE_ESM
This module was converted to be a ESM only package in version 3.0.0-beta.10 . node-fetch is an ESM-only module — you are not...
Read more >node-fetch doesn't throw an error when downloading a big file ...
When downloading a file bigger than 4 GiB (= 2 32 bytes) with http in a 32-bit environment, Node.js fails and throws the...
Read more >How to make a fetch request using node-fetch v3 - Netlify
This error message is letting us know that we are unable to use the require() syntax since it only works with CommonJS. Node-fetch...
Read more >Errors | Node.js v19.3.0 Documentation
For all EventEmitter objects, if an 'error' event handler is not provided, the error will be thrown, causing the Node.js process to report...
Read more >Unable to import `node-fetch` in service
This error originated either by throwing inside of an async function without a catch block, or by rejecting a promise which was not...
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
Thank you, maybe worth adding this wiki page to the contributing guidelines, I will be happy to do it after this issue.
Try following this document: https://github.com/muke1908/chat-e2ee/wiki/ENV-variables
You can message here, if you need any help. https://gitter.im/chat-e2ee/community