From the nodejs.dev site:
npx allows you to run that npm command without installing it first. If the command isn't found, npx will install it into a central cache:
They use this as an example:
npx cowsay "Hello"
But when I run that:
$ npx cowsay "Hello"
Need to install the following packages:
cowsay
Ok to proceed? (y)
Huh? Is there some preference that I need to set now? I'm used to npx
running things without installing them, like they say on nodejs.dev. I don't really want to install cowsay
in my globals.
Node v14.17.5
NPM 7.21.0
OS:ProductName: Mac OS X
ProductVersion: 10.15.7
Filed as an issue here: https://github.com/nodejs/nodejs.org/issues/4104
Edit: just tested this in NPM 6 and it works as expected. This might be a change in NPM post v6.
✗ npm --version
6.14.16
✗ npx cowsay "Hello"
npx: installed 41 in 7.509s
_______
< Hello >
...