We're using [email protected] in our pipeline for generating our documentation automatically.
Today we're facing a major problem when trying to install it. What's strange is that we're using version 0.6.1 for two months now without any problems. Today we started receiving the following problem without changing anything.
/usr/local/bin/redoc-cli -> /usr/local/lib/node_modules/redoc-cli/index.js
- [email protected] node_modules/redoc-cli/node_modules/nice-try
- [email protected] node_modules/redoc-cli/node_modules/p-defer
- [email protected] node_modules/redoc-cli/node_modules/map-age-cleaner
- [email protected] node_modules/redoc-cli/node_modules/p-is-promise
- [email protected] node_modules/redoc-cli/node_modules/semver
- [email protected] node_modules/redoc-cli/node_modules/xregexp
/usr/local/lib
โโโฌ [email protected]
โโโ UNMET PEER DEPENDENCY styled-components@^3.4.0
โโโฌ [email protected]
โโโ [email protected]
โโโฌ [email protected]
โ โโโฌ [email protected]
โ โโโฌ [email protected]
โ โโโฌ [email protected]
โ โโโ [email protected]
โโโฌ [email protected]
โ โโโฌ [email protected]
โ โ โโโฌ [email protected]
โ โ โโโฌ [email protected]
โ โ โโโ [email protected]
โ โ โโโ [email protected]
โ โโโฌ [email protected]
โ โ โโโ [email protected]
โ โโโ [email protected]
โโโ [email protected]
โโโ [email protected]
npm WARN [email protected] requires a peer of styled-components@^3.4.0 but none was installed.
Our script for installing the redoc-cli is the following:
#!/usr/bin/env bash
version=$(node -p "require('redoc-cli/package.json').version" 2>/dev/null)
[ "$version" == "0.6.1" ] || npm install -g [email protected]
redoc-cli bundle docs/api/specification.yml -o docs/index.html
We're helpless Java developers not knowing how we can fix that. Any help will be much appreciated
Thanks in advance
I am having the exact same problem. I dug a little deeper and tried to use npx to just print the version number to see if there was any kind of breaking change. I went through version 0.6.2, 0.6.1, 0.5.0, and 0.4.0 and all of them had the same issue.
docker run --rm node:8-alpine npx redoc-cli --version
npx: installed 120 in 5.969s
Cannot find module 'styled-components'
Ahh. Yes. IN the latest ReDoc alpha I moved styled-components to peerDependencies and forgot to update redoc-cli.
And redoc-cli installs each time the newest ReDoc version ("^2.0.0-alpha.37").
This issue should have been fixed in [email protected]. Could you verify?
To avoid similar issues in the future, use package-lock.json or yarn.lock. This way each redoc-cli install will install with the exact same version of dependencies.
I had the same error with 0.6.1.
With 0.6.3, a different error occurs:
version=$(node -p "require('redoc-cli/package.json').version" 2>/dev/null)
[ "$version" == "0.6.3" ] || npm install -g [email protected]
redoc-cli bundle docs/api/specification.yml -o docs/index.html
npm ERR! path /usr/local/lib/node_modules/redoc-cli/index.js
npm ERR! code ENOENT
npm ERR! errno -2
npm ERR! syscall chmod
npm ERR! enoent ENOENT: no such file or directory, chmod '/usr/local/lib/node_modules/redoc-cli/index.js'
npm ERR! enoent This is related to npm not being able to find a file.
npm ERR! enoent
My fault ๐. Should be fixed in 0.6.4
@RomanGotsiy no worries! Thank you for responding that quickly ๐
works! thanks so much for responding so quick @RomanGotsiy
(we'd got as far as figuring out it was pulling the latest 'redoc' alpha, but we were a bit stuck)
๐
Most helpful comment
My fault ๐. Should be fixed in
0.6.4