I am not entering my if (!error) statement, I know this because my console.log('in query') statement is not printing.
var express = require('express');
var fs= require('fs');
var request = require('request');
var cheerio = require('cheerio');
var app = express();
var crunchbase = require('crunchbase2');
var apikey='myapikey';
crunchbase.init(apikey);
console.log('after init');
crunchbase.people( {query: "1" }, function(error, results) {
console.log('in .people');
if (!error) {
console.log('in query');
console.log(results) // Print the search results
}
});
Any ideas? Thanks.
more details on error:
SyntaxError: Unexpected end of input at Object.parse (native) at Request._callback (/home/ubuntu/crunchbase/node_modules/crunchbase2/index.js:73:28) at Request.self.callback (/home/ubuntu/crunchbase/node_modules/request/request.js:198:22) at Request.emit (events.js:98:17) at Request. (/home/ubuntu/crunchbase/node_modules/request/request.js:1035:10) at Request.emit (events.js:117:20) at IncomingMessage. (/home/ubuntu/crunchbase/node_modules/request/request.js:962:12) at IncomingMessage.emit (events.js:117:20) at _stream_readable.js:944:16 at process._tickCallback (node.js:448:13)