Closed Crysalist closed 6 years ago
Which Node.JS version do you use?
This is Node complaining about a (
in this line and this may be the one after async
. async
support was introduced with V8 5.5 which is available since Node.JS 7.6. So if you are using an older version this won't work.
What's your Node.js version and OS?
Got it sorted ... issue was the error is not descriptive in linux. On Mac I saw what the issue where and fixed it. (There was a random reference that does not exist in the swagger file)
I used the default swagger spec on http://editor.swagger.io/ When I run it
snc swagspec.yaml -o ./my-api
orsnc swagspec.yaml
But I get error /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:542:28) at Object.Module._extensions..js (module.js:579:10) at Module.load (module.js:487:32) at tryModuleLoad (module.js:446:12) at Function.Module._load (module.js:438:3) at Module.require (module.js:497:17) at require (internal/module.js:20:19) at Object. (/usr/local/lib/node_modules/swagger-node-codegen/cli.js:6:17)