Uploading from VSCode with your code node.js fetch

When I write my code to bulk upload to IFPS VSCode throws 32m’ERR_REQUIRE_ESM’←[39m } error from the fetch line. Can anyone help me fix this?

Fetch ? Try ipfs-http-client instead.

1 Like

Error [ERR_REQUIRE_ESM]: require() of ES Module

Error [ERR_REQUIRE_ESM]: require() of ES Module

The error above is what I’m getting. The first four lines come from the storage section for node.js > fetch in VSCode. Then it throws an error above. When I’ve read into it it said something about incorrect modules but vs code has an extension that we wrote it as imports instead of require. And throws a different coat at that point so I’m not really sure what to do. I don’t code JavaScript so the module thing is really killing me.

There’re different module systems, and in different js versions module systems behave differently.

How do I fix it? I tried changing the node.js version but it didn’t work.