Javascript - Error: require is not defined -


i installed unirest.

in documentation provided following piece of code test unirest:

var unirest = require('unirest');      unirest.post('http://mockbin.com/request')     .header('accept', 'application/json')     .send({ 'parameter': 23, 'foo': 'bar' })     .end(function (response) {       console.log(response.body);     }); 

when add bit of code, following error in console:

error: require not defined 

the entire ui of site stops working well.

i've used require in past before , it's never given me error. there i'm forgetting include?

edit: forgot mention. yes, running in node.js environment.


Comments

Popular posts from this blog

sublimetext3 - what keyboard shortcut is to comment/uncomment for this script tag in sublime -

java - No use of nillable="0" in SOAP Webservice -

ubuntu - Laravel 5.2 quickstart guide gives Not Found Error -