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

Swagger-Editor npm install on macOS Catalina fails #2117

Closed
dove-young opened this issue Mar 4, 2020 · 2 comments · Fixed by #2118
Closed

Swagger-Editor npm install on macOS Catalina fails #2117

dove-young opened this issue Mar 4, 2020 · 2 comments · Fixed by #2118

Comments

@dove-young
Copy link

Q&A (please complete the following information)

  • OS: [e.g. macOS] - macOS Catalina
  • Browser: [e.g. chrome, safari]
  • Version: [e.g. 22]
  • Method of installation: [e.g. npm, dist assets] - npm
  • Swagger-Editor version: [e.g. 3.10.0] - 3.8.0
  • Swagger/OpenAPI version: [e.g. Swagger 2.0, OpenAPI 3.0]

Content & configuration

Example Swagger/OpenAPI definition:

# your YAML here

Swagger-Editor configuration options:

SwaggerEditor({
  // your config options here
})
?yourQueryStringConfig

Describe the bug you're encountering

To reproduce...

Steps to reproduce the behavior:

  1. Install nvm, nodejs
 brew install nvm
 mkdir ~/.nvm
 code ~/.zshrc
 . ~/.zshrc
 nvm ls-remote
 nvm install v6.17.1
  1. install swagger-editor and see error
 nvm use v6.17.1
 npm install swagger-editor
 ls node_modules
 cd node_modules/swagger-editor
 npm start

Expected behavior

Screenshots

Additional context or thoughts

> [email protected] start /Users/dove/Shell/GitHub/IBMCloudOps/Shentu/node_modules/swagger-editor
> npm-run-all --parallel serve-static open-static


> [email protected] open-static /Users/dove/Shell/GitHub/IBMCloudOps/Shentu/node_modules/swagger-editor
> node -e 'require("open")("http://localhost:3001")'


> [email protected] serve-static /Users/dove/Shell/GitHub/IBMCloudOps/Shentu/node_modules/swagger-editor
> http-server -i -a 0.0.0.0 -p 3001

/Users/dove/Shell/GitHub/IBMCloudOps/Shentu/node_modules/swagger-editor/node_modules/open/index.js:16
const wslToWindowsPath = async path => {
                               ^^^^

SyntaxError: Unexpected identifier
    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 [eval]:1:1

npm ERR! Darwin 19.2.0
npm ERR! argv "/Users/david/.nvm/versions/node/v6.17.1/bin/node" "/Users/david/.nvm/versions/node/v6.17.1/lib/node_modules/npm/bin/npm-cli.js" "run" "--swagger-editor:deps_check_dir=.deps_check" "open-static"
npm ERR! node v6.17.1
npm ERR! npm  v3.10.10
npm ERR! code ELIFECYCLE
npm ERR! [email protected] open-static: `node -e 'require("open")("http://localhost:3001")'`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the [email protected] open-static script 'node -e 'require("open")("http://localhost:3001")''.
npm ERR! Make sure you have the latest version of node.js and npm installed.
npm ERR! If you do, this is most likely a problem with the swagger-editor package,
npm ERR! not with npm itself.
npm ERR! Tell the author that this fails on your system:
npm ERR!     node -e 'require("open")("http://localhost:3001")'
npm ERR! You can get information on how to open an issue for this project with:
npm ERR!     npm bugs swagger-editor
npm ERR! Or if that isn't available, you can get their info via:
npm ERR!     npm owner ls swagger-editor
npm ERR! There is likely additional logging output above.

npm ERR! Please include the following file with any support request:
npm ERR!     /Users/dove/Shell/GitHub/IBMCloudOps/Shentu/node_modules/swagger-editor/npm-debug.log
ERROR: "open-static" exited with 1.

npm ERR! Darwin 19.2.0
npm ERR! argv "/Users/david/.nvm/versions/node/v6.17.1/bin/node" "/Users/david/.nvm/versions/node/v6.17.1/bin/npm" "start"
npm ERR! node v6.17.1
npm ERR! npm  v3.10.10
npm ERR! code ELIFECYCLE
npm ERR! [email protected] start: `npm-run-all --parallel serve-static open-static`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the [email protected] start script 'npm-run-all --parallel serve-static open-static'.
npm ERR! Make sure you have the latest version of node.js and npm installed.
npm ERR! If you do, this is most likely a problem with the swagger-editor package,
npm ERR! not with npm itself.
npm ERR! Tell the author that this fails on your system:
npm ERR!     npm-run-all --parallel serve-static open-static
npm ERR! You can get information on how to open an issue for this project with:
npm ERR!     npm bugs swagger-editor
npm ERR! Or if that isn't available, you can get their info via:
npm ERR!     npm owner ls swagger-editor
npm ERR! There is likely additional logging output above.

npm ERR! Please include the following file with any support request:
npm ERR!     /Users/dove/Shell/GitHub/IBMCloudOps/Shentu/node_modules/swagger-editor/npm-debug.log
@dove-young
Copy link
Author

Here is my npm-debug.log

0 info it worked if it ends with ok
1 verbose cli [ '/Users/david/.nvm/versions/node/v6.17.1/bin/node',
1 verbose cli   '/Users/david/.nvm/versions/node/v6.17.1/bin/npm',
1 verbose cli   'start' ]
2 info using [email protected]
3 info using [email protected]
4 verbose run-script [ 'prestart', 'start', 'poststart' ]
5 info lifecycle [email protected]~prestart: [email protected]
6 verbose lifecycle [email protected]~prestart: unsafe-perm in lifecycle true
7 verbose lifecycle [email protected]~prestart: PATH: /Users/david/.nvm/versions/node/v6.17.1/lib/node_modules/npm/bin/node-gyp-bin:/Users/dove/Shell/GitHub/IBMCloudOps/Shentu/node_modules/swagger-editor/node_modules/.bin:/Users/dove/Shell/GitHub/IBMCloudOps/Shentu/node_modules/.bin:/Users/david/.nvm/versions/node/v6.17.1/bin:/usr/local/opt/coreutils/libexec/gnubin:/Users/dove/anaconda/bin:/usr/local/Cellar/zsh/5.2/bin:/Users/david/go/bin:/usr/local/opt/coreutils/libexec/gnubin:/Users/dove/anaconda/bin:/usr/local/Cellar/zsh/5.2/bin:/Users/david/go/bin:/usr/local/bin:/usr/bin:/bin:/usr/sbin:/sbin:/usr/local/bin:/Users/david/bin:/usr/local/bin:/Users/david/bin
8 verbose lifecycle [email protected]~prestart: CWD: /Users/dove/Shell/GitHub/IBMCloudOps/Shentu/node_modules/swagger-editor
9 silly lifecycle [email protected]~prestart: Args: [ '-c', 'npm install' ]
10 silly lifecycle [email protected]~prestart: Returned: code: 0  signal: null
11 info lifecycle [email protected]~start: [email protected]
12 verbose lifecycle [email protected]~start: unsafe-perm in lifecycle true
13 verbose lifecycle [email protected]~start: PATH: /Users/david/.nvm/versions/node/v6.17.1/lib/node_modules/npm/bin/node-gyp-bin:/Users/dove/Shell/GitHub/IBMCloudOps/Shentu/node_modules/swagger-editor/node_modules/.bin:/Users/dove/Shell/GitHub/IBMCloudOps/Shentu/node_modules/.bin:/Users/david/.nvm/versions/node/v6.17.1/bin:/usr/local/opt/coreutils/libexec/gnubin:/Users/dove/anaconda/bin:/usr/local/Cellar/zsh/5.2/bin:/Users/david/go/bin:/usr/local/opt/coreutils/libexec/gnubin:/Users/dove/anaconda/bin:/usr/local/Cellar/zsh/5.2/bin:/Users/david/go/bin:/usr/local/bin:/usr/bin:/bin:/usr/sbin:/sbin:/usr/local/bin:/Users/david/bin:/usr/local/bin:/Users/david/bin
14 verbose lifecycle [email protected]~start: CWD: /Users/dove/Shell/GitHub/IBMCloudOps/Shentu/node_modules/swagger-editor
15 silly lifecycle [email protected]~start: Args: [ '-c', 'npm-run-all --parallel serve-static open-static' ]
16 silly lifecycle [email protected]~start: Returned: code: 1  signal: null
17 info lifecycle [email protected]~start: Failed to exec start script
18 verbose stack Error: [email protected] start: `npm-run-all --parallel serve-static open-static`
18 verbose stack Exit status 1
18 verbose stack     at EventEmitter.<anonymous> (/Users/david/.nvm/versions/node/v6.17.1/lib/node_modules/npm/lib/utils/lifecycle.js:255:16)
18 verbose stack     at emitTwo (events.js:106:13)
18 verbose stack     at EventEmitter.emit (events.js:191:7)
18 verbose stack     at ChildProcess.<anonymous> (/Users/david/.nvm/versions/node/v6.17.1/lib/node_modules/npm/lib/utils/spawn.js:40:14)
18 verbose stack     at emitTwo (events.js:106:13)
18 verbose stack     at ChildProcess.emit (events.js:191:7)
18 verbose stack     at maybeClose (internal/child_process.js:920:16)
18 verbose stack     at Process.ChildProcess._handle.onexit (internal/child_process.js:230:5)
19 verbose pkgid [email protected]
20 verbose cwd /Users/dove/Shell/GitHub/IBMCloudOps/Shentu/node_modules/swagger-editor
21 error Darwin 19.2.0
22 error argv "/Users/david/.nvm/versions/node/v6.17.1/bin/node" "/Users/david/.nvm/versions/node/v6.17.1/bin/npm" "start"
23 error node v6.17.1
24 error npm  v3.10.10
25 error code ELIFECYCLE
26 error [email protected] start: `npm-run-all --parallel serve-static open-static`
26 error Exit status 1
27 error Failed at the [email protected] start script 'npm-run-all --parallel serve-static open-static'.
27 error Make sure you have the latest version of node.js and npm installed.
27 error If you do, this is most likely a problem with the swagger-editor package,
27 error not with npm itself.
27 error Tell the author that this fails on your system:
27 error     npm-run-all --parallel serve-static open-static
27 error You can get information on how to open an issue for this project with:
27 error     npm bugs swagger-editor
27 error Or if that isn't available, you can get their info via:
27 error     npm owner ls swagger-editor
27 error There is likely additional logging output above.
28 verbose exit [ 1, true ]

@tim-lai
Copy link
Contributor

tim-lai commented Mar 6, 2020

@dove-young Thanks for the report. I've updated the documentation that now recommends using current versions of Node. I can confirm that swagger-editor failed local dev install on MacOS Catalina/Node 6/npm 3. Installation was successful on Node 8/npm 6, as well as Node 10 and Node 12 for me. Fyi, Node 8 was end-of-life Dec'19 as well, so hopefully you are able to use Node 10 or Node 12 for your application.

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

Successfully merging a pull request may close this issue.

2 participants