ReferenceError: fetch is not defined
snippet in javascript

ReferenceError: fetch is not defined

user4506

global.fetch = require("node-fetch");

ReferenceError: fetch is not defined

user5584

const fetch = require("node-fetch");

ReferenceError: fetch is not defined

user1974

npm i node-fetch --save