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

npm run swagger fails #385

Open
githubber opened this issue Jul 13, 2022 · 1 comment
Open

npm run swagger fails #385

githubber opened this issue Jul 13, 2022 · 1 comment

Comments

@githubber
Copy link

githubber commented Jul 13, 2022

Hello! Cool app!
I've followed all the instructions, everything seems ok EXCEPT npm run swagger fails in teh four microservice directories. Here is the the terminal output, and the log (they seem to say teh same thing). Can anyone tell me what's wrong?? Thank you. I'm doing this on Ubuntu 20 server.

me@host:/var/www/socioboard/socioboard-api/User$ npm run swagger

> [email protected] swagger /var/www/socioboard/socioboard-api/User
> node ./resources/views/swagger.config.js

file:///var/www/socioboard/socioboard-api/User/resources/views/swagger.config.js:179
await swagger(outputFile, endpointsFiles, doc);
^^^^^

SyntaxError: Unexpected reserved word
    at Loader.moduleStrategy (internal/modules/esm/translators.js:140:18)
    at async link (internal/modules/esm/module_job.js:42:21)
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! [email protected] swagger: `node ./resources/views/swagger.config.js`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the [email protected] swagger script.
npm ERR! This is probably not a problem with npm. There is likely additional logging output above.

npm ERR! A complete log of this run can be found in:
npm ERR!     /home/me/.npm/_logs/2022-07-13T23_42_14_546Z-debug.log

0 info it worked if it ends with ok
1 verbose cli [ '/usr/bin/node', '/usr/bin/npm', 'run', 'swagger' ]
2 info using [email protected]
3 info using [email protected]
4 verbose run-script [ 'preswagger', 'swagger', 'postswagger' ]
5 info lifecycle [email protected]~preswagger: [email protected]
6 info lifecycle [email protected]~swagger: [email protected]
7 verbose lifecycle [email protected]~swagger: unsafe-perm in lifecycle true
8 verbose lifecycle [email protected]~swagger: PATH: /usr/lib/node_modules/npm/node_modules/npm-lifecycle/node-gyp-bin:/var/www/socioboard/socioboard-api/User/node_modules/.bin:/usr/local/sbin:/usr/local/>9 verbose lifecycle [email protected]~swagger: CWD: /var/www/socioboard/socioboard-api/User
10 silly lifecycle [email protected]~swagger: Args: [ '-c', 'node ./resources/views/swagger.config.js' ]
11 silly lifecycle [email protected]~swagger: Returned: code: 1  signal: null
12 info lifecycle [email protected]~swagger: Failed to exec swagger script
13 verbose stack Error: [email protected] swagger: `node ./resources/views/swagger.config.js`
13 verbose stack Exit status 1
13 verbose stack     at EventEmitter.<anonymous> (/usr/lib/node_modules/npm/node_modules/npm-lifecycle/index.js:332:16)
13 verbose stack     at EventEmitter.emit (events.js:314:20)
13 verbose stack     at ChildProcess.<anonymous> (/usr/lib/node_modules/npm/node_modules/npm-lifecycle/lib/spawn.js:55:14)
13 verbose stack     at ChildProcess.emit (events.js:314:20)
13 verbose stack     at maybeClose (internal/child_process.js:1022:16)
13 verbose stack     at Process.ChildProcess._handle.onexit (internal/child_process.js:287:5)
14 verbose pkgid [email protected]
15 verbose cwd /var/www/socioboard/socioboard-api/User
16 verbose Linux 5.4.0-28-generic
17 verbose argv "/usr/bin/node" "/usr/bin/npm" "run" "swagger"
18 verbose node v12.22.12
19 verbose npm  v6.14.16
20 error code ELIFECYCLE
21 error errno 1
22 error [email protected] swagger: `node ./resources/views/swagger.config.js`
22 error Exit status 1
23 error Failed at the [email protected] swagger script.
23 error This is probably not a problem with npm. There is likely additional logging output above.
24 verbose exit [ 1, true ]
@nico-i
Copy link

nico-i commented Apr 11, 2023

Hi @githubber, I ran into the same issue. The solution for me was that the node version I used did not support async functions. I installed the newest version of node using nvm with this guide and now npm run swagger runs without a hitch.

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

2 participants