console.log problems
superlowburn opened this issue · 1 comments
I'm new to node & js....
`const WebPageTest = require('webpagetest');
const wpt = new WebPageTest('example.net'); // default: www.webpagetest.org
const wptPublic = new WebPageTest('www.webpagetest.org', 'A.e88xxxxxxxxxxxxxxxxx3d');
wpt.runTest('https://twitter.com/marcelduran', {location: 'SanJose_IE9'}, (err, data) => {
console.log(err || data);
});
`
When using the above I get errors like crazy:
$ node other.js
{ Error
at Object. (/Users/moose/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. (/Users/moose/node_modules/webpagetest/lib/webpagetest.js:14:15)
at Module._compile (module.js:571:32) name: 'WPTAPIError', code: 404, message: 'Not Found' }
If I run the above code with the console bit gone
wpt.runTest('https://twitter.com/marcelduran',
{location: 'SanJose_IE9'});` it doesn't error, thought I also get no output.
Nvrmnd. I open node then input it & it worked fine.