timqian / gql-generator

Generate queries from graphql schema, used for writing api test.
MIT License
374 stars 93 forks source link

SyntaxError: Unexpected token ... #1

Open ravensnowbird opened 6 years ago

ravensnowbird commented 6 years ago

Unable to run

npm install gql-generator -g

Response

/usr/lib/node_modules/gql-generator/index.js:72
    const meta = { ...fieldData.meta };
                   ^^^

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)
timqian commented 6 years ago

@ravensnowbird The reason is you are using an old version of node. What node version are you using? Can you upgrade node to at least node V8? https://nodejs.org/en/ I will document this in the readme later

ikatun commented 6 years ago

@timqian do you want a pull request with build configuration to transpile the package for older node?