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
Post a Comment