Having trouble with import from node-fetch? How do I properly set it up in my project?

18 Replies, 743 Views

Hey! If you’re stuck on importing from node-fetch, it’s likely an ESM issue. Node 16 handles ESM differently, so you’ll need to either:
1. Add `"type": "module"` to your package.json, or
2. Use `.mjs` file extensions for your modules.

Also, check out this guide on ESM in Node.js—it’s super helpful: [link]. Let me know if you need more help!

Messages In This Thread



Users browsing this thread: 1 Guest(s)