fnogatz / xsd2json

Translate XML Schema into equivalent JSON Schema
MIT License
149 stars 28 forks source link

Error Running xsd2json - SyntaxError: missing ) after argument list #125

Open HSBawa opened 3 years ago

HSBawa commented 3 years ago

Thoughts what the issue might be? Commands and Error information is mentioned below:

OS: Windows 10 w/ latest swipl, nodejs and xsd2json installed.

Run Option 1: C:\Users\name\Desktop\WSDL-JSON>xsd2json ./add-note-dev.wsdl

Run Option 2: C:\Users\name\Desktop\WSDL-JSON>node C:\Users\name\AppData\Roaming\npm\xsd2json ./add-note-dev.wsdl

Error with both of the above options:

basedir=$(dirname "$(echo "$0" | sed -e 's,\\,/,g')")
          ^^^^^^^

SyntaxError: missing ) after argument list
←[90m    at wrapSafe (internal/modules/cjs/loader.js:979:16)←[39m
←[90m    at Module._compile (internal/modules/cjs/loader.js:1027:27)←[39m
←[90m    at Object.Module._extensions..js (internal/modules/cjs/loader.js:1092:10)←[39m
←[90m    at Module.load (internal/modules/cjs/loader.js:928:32)←[39m
←[90m    at Function.Module._load (internal/modules/cjs/loader.js:769:14)←[39m
←[90m    at Function.executeUserEntryPoint [as runMain] (internal/modules/run_main.js:72:12)←[39m
←[90m    at internal/main/run_main_module.js:17:47←[39m
fnogatz commented 3 years ago

To be honest, I never tried to work with xsd2json on the Windows Subsystem for Linux. The shown error has its origins in the node.js part of this project. However, xsd2json actually is just a module for SWI-Prolog, with a node.js wrapper for easier use.

Therefore, you could try to get the SWI-Prolog part working as described in in lib-pl/README.md: Clone this repository, go to the lib-pl directory, and run it as follows:

swipl -g main cli.pl -- /path/to/your.xsd

Does this work for you?