Node BigQuery package -- ENOENT error on Ubuntu

Saturday, May 3, 2014

I am trying to use the BigQuery package found here:

Setup: Ubuntu 14, latest Node, nginx, plus that bigquery package and its dependencies.

I believe I've set it up correctly, including the PEM files, but I am getting an error from gauth when I try to load the key files:

[2014-05-04 02:14:57.008] [ERROR] gauth - { [Error: ENOENT, open './']
errno: 34,
code: 'ENOENT',
path: './' }
Error: ENOENT, open './'

I am running just a simple test script that looks like so (I've Xxxx'd out my project ID):

var http = require('http')
, bq = require('bigquery')
, fs = require('fs')
, prjId = 'xxxxxxxxxx'; //you need to modify this

scope: '',
client_secret: './client_secrets.json',
privatekey_pem: './',
key_pem: './'

http.createServer(function (req, res) {
res.writeHead(200, {'Content-Type': 'text/plain'});
res.write('Testing BigQuery... \n');

bq.job.query(prjId, 'select count(*) from publicdata:samples.wikipedia', function(e,r,d){
if(e) console.log(e);
console.log( JSON.stringify(d) );

res.end('Done. \n');
}).listen(3000, "");
console.log('Server running at');

I've tried referencing the file different, using __dirname and also no slashes.

Any thoughts? I'm looking at the Google code in the dependencies, too, but just not figuring this one out.