Question: How do I make nyc visible to zsh?
Steps to recreate:
yarn add nyc -g
(I was following steps that used npm so I just replaced npm i
with yarn add
)nyc report --reporter=html
zsh: command not found: nyc
npx nyc --help
, I got a full list of nyc functions!yarn add -D
(from the official nyc documentation)nyc report --reporter=text-lcov
. Once again:zsh: command not found: nyc
Turns out I didn't install nyc globally. If that's the case for you, you can run nyc by appending npx
before any nyc command (which is why npx nyc --help
was working).
If you want to install nyc globally with yarn, you have to do:
yarn global add nyc