Answers for "Module not found: Error: Can't resolve 'encoding' in '/Users/jameshome/Documents/projects/brightworldappnativescript/node_modules/node-fetch/lib'"

15

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));
Posted by: Guest on June-02-2020
1

how to install node fetch

$ npm install node-fetch --save
Posted by: Guest on June-10-2020

Code answers related to "Module not found: Error: Can't resolve 'encoding' in '/Users/jameshome/Documents/projects/brightworldappnativescript/node_modules/node-fetch/lib'"

Code answers related to "Javascript"

Browse Popular Code Answers by Language