Redoc: npm install and redoc-cli bundle fails

Created on 28 Oct 2020  路  2Comments  路  Source: Redocly/redoc

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:/# 

Most helpful comment

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.

All 2 comments

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.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

zmes50416 picture zmes50416  路  3Comments

dvh picture dvh  路  3Comments

skllcrn picture skllcrn  路  3Comments

vietnguyen010 picture vietnguyen010  路  3Comments

gavinkalika picture gavinkalika  路  3Comments