Thursday, 16 March 2017

Why is this console.log code creating these errors?

The following console.log code causes me all kinds of errors:

wpt.runTest('https://twitter.com/marcelduran', {location: 'SanJose_IE9'}, (err, data) => {
  console.log(err || data);
  });

$ node other.js 
 { Error
at Object.<anonymous> (/Users/steve/node_modules/webpagetest/lib/helper.js:213:25)
at Module._compile (module.js:571:32)
at Object.Module._extensions..js (module.js:580:10)
at Module.load (module.js:488:32)
at tryModuleLoad (module.js:447:12)
at Function.Module._load (module.js:439:3)
at Module.require (module.js:498:17)
at require (internal/module.js:20:19)
at Object.<anonymous> (/Users/steve/node_modules/webpagetest/lib/webpagetest.js:14:15)
at Module._compile (module.js:571:32) name: 'WPTAPIError', code: 404, message: 'Not Found' }

If run as wpt.runTest('https://twitter.com/marcelduran', {location: 'SanJose_IE9'}); it runs fine, but I don't get any output.

Thoughts? Newb to node/js, obv. Thanks.



via ComfortMoose

No comments:

Post a Comment