Skip to content

Speech Sample Project not working #281

Description

@anthonybaker

The Speech Sample Project is not working. I cloned the repo, and setup the Speech Recognition Sample following the instructions.
https://github.com/GoogleCloudPlatform/nodejs-docs-samples/tree/master/speech

When I try to run the command:

node recognize.js --help

I get the following error:

const Speech = require('@google-cloud/speech');
^^^^^
SyntaxError: Use of const in strict mode.
    at Module._compile (module.js:439:25)
    at Object.Module._extensions..js (module.js:474:10)
    at Module.load (module.js:356:32)
    at Function.Module._load (module.js:312:12)
    at Function.Module.runMain (module.js:497:10)
    at startup (node.js:119:16)
    at node.js:906:3

I tried passing the harmony flag:

node --harmony recognize.js --help

But then, I got another error:

   .then((results) => {
                     ^
SyntaxError: Unexpected token >
    at Module._compile (module.js:439:25)
    at Object.Module._extensions..js (module.js:474:10)
    at Module.load (module.js:356:32)
    at Function.Module._load (module.js:312:12)
    at Function.Module.runMain (module.js:497:10)
    at startup (node.js:119:16)
    at node.js:906:3

My node version is:
v7.3.0

I would expect the sample code to run without issues. I haven't touched the recognize.js file, apart fro adding my project id.

I'd appreciate the help.

Many thanks
-Anthony

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    🚨This issue needs some love.triage meI really want to be triaged.

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions