Installed redoc-cli npm package but on trying to run it, it says command not found. macOS 10.15.4

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-cli

Looks 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/bin

I tried switching my shell to bash but the error persists.

2

1 Answer

Looks like the trouble was that I had not installed redoc-cli globally.

The following steps fixed the issue:

  1. Uninstall redoc-cli and redoc
npm uninstall redoc-cli -S
npm uninstall redoc -S
  1. Install redoc-cli globally
npm install redoc-cli -g
2

Your Answer

Sign up or log in

Sign up using Google Sign up using Facebook Sign up using Email and Password

Post as a guest

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

You Might Also Like