GeezerVison is showing github.com — SyntaxError on authentication command · Issue #1387 · googleapis/google-cloud-node
SyntaxError on authentication command #1387DescriptionThe simple code below throws a SyntaxError.
var fs = require('fs');
var googleCloudAuthFile = __dirname + '/google_cloud_auth.json';
fs.accessSync(googleCloudAuthFile, fs.F_OK);
var gcloud = require('gcloud')({
projectId: 'project-id',
keyFilename: googleCloudAuthFile
});
/vagrant/parse/city-chat-web/node_modules/readable-stream/lib/_stream_readable.js:117
};
^
SyntaxError: Unexpected token ;
at exports.runInThisContext (vm.js:53:16)
at Module._compile (module.js:387:25)
at Object.Module._extensions..js (module.js:422:10)
at Module.load (module.js:357:32)
at Function.Module._load (module.js:314:12)
at Module.require (module.js:367:17)
at require (internal/module.js:16:19)
at Object.<anonymous> (/vagrant/parse/city-chat-web/node_modules/readable-stream/readable.js:6:28)
at Module._compile (module.js:413:34)
at Object.Module._extensions..js (module.js:422:10)
Activityleonardojobim commented on Jun 16, 2016 I created an empty project with only gcloud-node installed and the authentication worked. It also successfully made a safeSearch request.
I think the error in this issue can be an conflict with other package. The packages of the real project are:
"dependencies": {
"apn": "^1.7.5",
"async": "^1.5.2",
"express": "^4.13.4",
"gcloud": "^0.36.0",
"node-gcm": "^0.14.3",
"parse-server": "^2.1.6",
"request": "^2.69.0"
}stephenplusplus commented on Jun 16, 2016 The code from the first post worked for me. Is it possible to get a sample repo that I can clone to see the failure? The details of the Vagrant VM and how Node was installed might be relevant as well. leonardojobim commented on Jun 20, 2016 @stephenplusplus If you run the same code with the dependences listed above, you'll see the error.
Please declare those dependences in package.json and run npm install. Then run the code.
The version of the Node.js is 5.5.0 and it was installed through Node Version Manager (https://github.com/creationix/nvm). stephenplusplus commented on Jun 20, 2016 I've tried this, but the script still executes normally. stephenplusplus commented on Jun 22, 2016 stephenplusplus commented on Jun 27, 2016 I'm going to close this out since I can't reproduce. I don't believe this is an issue with our library, but something environment-specific. If you're still stuck, feel free to keep sharing, and I'll gladly help however I can. added 2 commits that reference this issue on Feb 26, 2026This issue will close once commit dc10da6 is merged into the 'main' branch.dc10da6 This issue will close once commit e195312 is merged into the 'main' branch.e195312
MetadataMetadataDevelopmentNo branches or pull requestsIssue actions
|