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 install and redoc-cli bundle fails #1442

Closed
pohmelie opened this issue Oct 28, 2020 · 2 comments
Closed

npm install and redoc-cli bundle fails #1442

pohmelie opened this issue Oct 28, 2020 · 2 comments

Comments

@pohmelie
Copy link

After last update to 0.10.0 redoc-cli bundle stop working.
How to reproduce:

Start node latest image

$ docker run --rm -it node:latest bash

Install redoc-cli globaly

root@002d9cd64e60:/# npm install -g redoc-cli
npm WARN ERESOLVE overriding peer dependency
npm WARN Found: [email protected]
npm WARN node_modules/redoc-cli/node_modules/mobx
npm WARN   mobx@"^6.0.1" from [email protected]
npm WARN   node_modules/redoc-cli
npm WARN     redoc-cli@"*" from the root project
npm WARN   1 more (redoc)
npm WARN 
npm WARN Could not resolve dependency:
npm WARN peer mobx@"^5.15.4 || ^4.15.4" from [email protected]
npm WARN node_modules/redoc-cli/node_modules/mobx-react
npm WARN   mobx-react@"^6.2.2" from [email protected]
npm WARN   node_modules/redoc-cli/node_modules/redoc

added 265 packages, and audited 265 packages in 12s

16 packages are looking for funding
  run `npm fund` for details

found 0 vulnerabilities
npm notice 
npm notice New patch version of npm available! 7.0.3 -> 7.0.6
npm notice Changelog: https://github.com/npm/cli/releases/tag/v7.0.6
npm notice Run npm install -g [email protected] to update!
npm notice 

Try to bundle something

root@002d9cd64e60:/# redoc-cli bundle /path/to/openapi3.yml
/usr/local/lib/node_modules/redoc-cli/node_modules/mobx-react/node_modules/mobx/lib/mobx.js:20
        throw new Error("[mobx] " + (message || OBFUSCATED_ERROR));
        ^

Error: [mobx] There are multiple, different versions of MobX active. Make sure MobX is loaded only once or use `configure({ isolateGlobalState: true })`
    at invariant (/usr/local/lib/node_modules/redoc-cli/node_modules/mobx-react/node_modules/mobx/lib/mobx.js:20:15)
    at fail (/usr/local/lib/node_modules/redoc-cli/node_modules/mobx-react/node_modules/mobx/lib/mobx.js:15:5)
    at Timeout._onTimeout (/usr/local/lib/node_modules/redoc-cli/node_modules/mobx-react/node_modules/mobx/lib/mobx.js:1487:17)
    at listOnTimeout (node:internal/timers:555:17)
    at processTimers (node:internal/timers:498:7)
root@002d9cd64e60:/# 
@RomanHotsiy
Copy link
Member

This is caused by new npm@7 (shipped with nod@15) is installing peer dependencies by default and a dependency we use (mobx-react) specifies the wrong peer dependency:

mobx@"^5.15.4 || ^4.15.4" from [email protected]

As a workaround use the LTS version of node.js.

I will open a pr aginst mobx-react later.

rbuysse added a commit to Cargill/grid-docs that referenced this issue Oct 28, 2020
The node base image was recently updated causing builds to fail
during installation of redoc. Once the issue described at
Redocly/redoc#1442 is resolved, this
change should be reverted.

Signed-off-by: Ryan Beck-Buysse <[email protected]>
rbuysse added a commit to rbuysse/splinter-docs that referenced this issue Oct 28, 2020
The node base image was recently updated causing builds to fail
during installation of redoc. Once the issue described at
Redocly/redoc#1442 is resolved, this
change should be reverted.

Signed-off-by: Ryan Beck-Buysse <[email protected]>
rbuysse added a commit to rbuysse/splinter-docs that referenced this issue Oct 28, 2020
The node base image was recently updated causing builds to fail
during installation of redoc. Once the issue described at
Redocly/redoc#1442 is resolved, this
change should be reverted.

Signed-off-by: Ryan Beck-Buysse <[email protected]>
rbuysse added a commit to Cargill/grid-docs that referenced this issue Oct 28, 2020
The "latest" image is based off stretch so lts-stretch is a better
replacement. This commit and commit a5753990c should be reverted
once Redocly/redoc#1442 is resolved.

Signed-off-by: Ryan Beck-Buysse <[email protected]>
rbuysse added a commit to Cargill/grid-docs that referenced this issue Oct 28, 2020
The "latest" image is based off stretch so lts-stretch is a better
replacement. This commit and commit 5753990 should be reverted
once Redocly/redoc#1442 is resolved.

Signed-off-by: Ryan Beck-Buysse <[email protected]>
@RomanHotsiy
Copy link
Member

Fixed in [email protected]

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