Skip to content

SyntaxError on authentication command #1387

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
leonardojobim opened this issue Jun 16, 2016 · 6 comments
Closed

SyntaxError on authentication command #1387

leonardojobim opened this issue Jun 16, 2016 · 6 comments
Assignees
Labels
type: question Request for information or clarification. Not an issue.

Comments

@leonardojobim
Copy link

The 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)
@leonardojobim
Copy link
Author

leonardojobim commented 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
Copy link
Contributor

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
Copy link
Author

@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
Copy link
Contributor

I've tried this, but the script still executes normally.

@stephenplusplus
Copy link
Contributor

@Leo-One try Node's stable release, v6.

@stephenplusplus
Copy link
Contributor

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
type: question Request for information or clarification. Not an issue.
Projects
None yet
Development

No branches or pull requests

2 participants