Here's what I have done. See the last line for the error:
cb-machan@cb-machan bin % npm i redoc-cli
> styled-components@4.4.1 postinstall /usr/local/bin/node_modules/styled-components
> node ./scripts/postinstall.js || exit 0
Use styled-components at work? Consider supporting our development efforts at
npm WARN saveError ENOENT: no such file or directory, open '/usr/local/bin/package.json'
npm WARN enoent ENOENT: no such file or directory, open '/usr/local/bin/package.json'
npm WARN bin No description
npm WARN bin No repository field.
npm WARN bin No README data
npm WARN bin No license field.
+ redoc-cli@0.9.7
added 309 packages from 211 contributors and audited 1381 packages in 37.029s
9 packages are looking for funding run `npm fund` for details
found 1 low severity vulnerability run `npm audit fix` to fix them, or `npm audit` for details
cb-machan@cb-machan bin % redoc-cli --help
zsh: command not found: redoc-cliLooks like my PATH variable is set properly:
cb-machan@cb-machan bin % npm prefix
/usr/local/bin
cb-machan@cb-machan bin % echo $path
/usr/local/bin /usr/bin /bin /usr/sbin /sbin /usr/local/mysql/bin /Users/cb-machan/apache-ant-1.10.7/binI tried switching my shell to bash but the error persists.
21 Answer
Looks like the trouble was that I had not installed redoc-cli globally.
The following steps fixed the issue:
- Uninstall
redoc-cliandredoc
npm uninstall redoc-cli -Snpm uninstall redoc -S- Install
redoc-cliglobally
npm install redoc-cli -g 2