Skip to content
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

Node.js error at running index.js : app.get('/callback', async (req, res) => { #62

Closed
arioboo opened this issue Oct 2, 2020 · 2 comments

Comments

@arioboo
Copy link

arioboo commented Oct 2, 2020

Hello, I have configured my lichess account to have an oauth app and a personal API token.
When I was following the instructions of the oauth_app example, the following happened when I ran "node index.js"

app.get('/callback', async (req, res) => {
                           ^

SyntaxError: Unexpected token (
    at createScript (vm.js:56:10)
    at Object.runInThisContext (vm.js:97:10)
    at Module._compile (module.js:549:28)
    at Object.Module._extensions..js (module.js:586:10)
    at Module.load (module.js:494:32)
    at tryModuleLoad (module.js:453:12)
    at Function.Module._load (module.js:445:3)
    at Module.runMain (module.js:611:10)
    at run (bootstrap_node.js:387:7)
    at startup (bootstrap_node.js:153:9)

I have no idea of how to handle this error, and I'm new to nodejs. A better documentation or a quick help would be needed.

@casalazara
Copy link

I'm also new to nodejs but maybe trying with " async function (req, res) => { " would work or trying to replace those characters like " " or ' ', it might be a problem of the encoding, for example some "" that were copied in another format

@niklasf
Copy link
Member

niklasf commented Oct 22, 2020

You're probably running a very old nodejs. Updated the example to specify a minimum version.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants