mulesoft-labs / api-console-cli

A CLI tools for the API console.
Other
14 stars 15 forks source link

Bower dependency error for raml-json-enhance #21

Closed julien-lafont closed 6 years ago

julien-lafont commented 6 years ago

Hello,

I've noticed yesterday that I cannot anymore run a api-console-cli build task without having this error, from a fresh install (rm -Rf .node_modules; npm install api-console-cli).

error: bower                        ECONFLICT Unable to find suitable version for raml-json-enhance

error:  
error: undefined
error: undefined
error: 

Verbose log: https://gist.github.com/julien-lafont/544c53561d2e49157dfbb379a10c4cd6 (node: v9.2.0, npm: 5.6.0)

I've tried some version tweaks, without success. I've seen there are tickets opened about "Required json property not found", is it related to my problem? And is there a workaround ?

Thank you!

edit: I've isolated a bit more the problem: by forcing a resolution of raml-json-enhance to 0.3.2, I can see this incompatibility warning:

Please note that,
    raml-request-panel#0.3.2 depends on raml-json-enhance#^0.2.0 which resolved to raml-json-enhance#0.2.9
    arc-demo-helpers#1.0.26, raml-docs-helpers#1.0.12 depends on raml-json-enhance#^0.3.2 which resolved to raml-json-enhance#0.3.2
Resort to using raml-json-enhance#0.3.2 which resolved to raml-json-enhance#0.3.2
ericwood73 commented 6 years ago

It is very troubling to have these types of unexpected errors when we are using API console in production as part of our CI process. There needs to be a way to pin all versions of dependencies in order to create a stable environment that can reliably build api-consoles without issue. At this point I'm thinking of putting the initial build into a docker container build so that we can always have a working environment to fall back to.

ericwood73 commented 6 years ago

I was just able to generate an api.json. If you have an index.html already, you may be able to use these steps to get past this issue.

  1. First I installed bower manually using npm install -g bower
  2. Then I installed api console using bower install --save mulesoft/api-console
  3. Next I installed the json enhancer and parser using bower install --save advanced-rest-client/raml-json-enhance advanced-rest-client/raml-js-parser
  4. I was prompted to select a version for raml-json-enhance. I chose 0.3.2
  5. Now I used cli to generate json using api-console generate-json --verbose main.raml --output build/api.json
  6. I already had an index.html so I just put api.json in the same directory and the API console appears to function as expected.
julien-lafont commented 6 years ago

It's a little better with the latest api-console release (https://github.com/mulesoft/api-console/releases/tag/v4.2.1), but the #18 is now triggered (it require to manually override the raml-json-enhance-node dependency to 0.3.x)

jarrodek commented 6 years ago

Fixed by https://github.com/mulesoft-labs/api-console-cli/commit/b96481553599857b6d10369e6c89034915a989c9

julienlafont-tabmo commented 6 years ago

Thank you for the fix!