ReferenceError: fetch is not defined
const fetch = require("node-fetch");
ReferenceError: fetch is not defined
const fetch = require("node-fetch");
node js fetch
const fetch = require('node-fetch'); //npm install node-fetch
fetch('https://httpbin.org/post', {
method: 'POST',
body: 'a=1'
})
.then(res => res.json())
.then(json => {
// Do something...
})
.catch(err => console.log(err));
ReferenceError: fetch is not defined
npm i node-fetch --save
nodejs server fetch is not defined
npm i node-fetch --save
how to install node fetch
$ npm install node-fetch --save
Copyright © 2021 Codeinu
Forgot your account's password or having trouble logging into your Account? Don't worry, we'll help you to get back your account. Enter your email address and we'll send you a recovery link to reset your password. If you are experiencing problems resetting your password contact us