fmvilas / swagger-node-codegen

An OpenAPI 3.x/Swagger 2 code generator for Node.js
Apache License 2.0
200 stars 55 forks source link

Getting an exception on Mac #24

Closed manwithsteelnerves closed 6 years ago

manwithsteelnerves commented 6 years ago

I tried with a sample over here but it is always giving an exception.

May I know what could be the issue?

Node : v6.13.1

/usr/local/lib/node_modules/swagger-node-codegen/lib/codegen.js:138
    walker.on('file', async (root, stats, next) => {
                            ^

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.require (module.js:504:17)
    at require (internal/module.js:20:19)
    at Object.<anonymous> (/usr/local/lib/node_modules/swagger-node-codegen/cli.js:6:17)

Thanks, Ayyappa

richardklose commented 6 years ago

You need at least Node.JS 7.6. This comes from async, which was introduced in Node.JS 7.6.

fmvilas commented 6 years ago

We should document the requirements. I'll make a PR in a few minutes.

fmvilas commented 6 years ago

I'm closing this issue. Feel free to keep commenting here.