I have this error when I compile my code in node.js, how can I fix it?
RefernceError: fetch is not defined
This is the function I am doing, it is re
The fetch API is not implemented in Node.
You need to use an external module for that, like node-fetch.
Install it in your Node application like this
npm i node-fetch --save
then put the line below at the top of the files where you are using the fetch API:
const fetch = require("node-fetch");