Closed benderTheCrime closed 6 years ago
I'm not sure this particularly falls in the category of a footgun, and it turns out there is special consideration that has gone into making sure npx npx npx npx npx npx ...
works, in the past. I think it's definitely a useful thing to support, since npx npx@version1 ...
is a useful thing that even I've done before.
That's pretty funny though.
Since this is intentional, and I don't think a particularly terrible footgun, I'm just gonna close this. Cheers!
First of all, let me just say that npx is objectively better than having to call "./node_modules/.bin/xxx." Thanks for the convenience that this has provided specific to my npm lifecycle scripts.
This would fall under the category of feature requests, although it's certainly not a necessity and likely is a useful side-effect to the behavior of npx.
From the command line, I can chain npx infinitely:
which definitely doesn't fall under the bug category, but I almost committed code that read:
as opposed to
Which seems like a "me" problem, but I like tools that prevent foot guns.
It may be that this is desired behavior (full disclosure, I didn't pour over the documentation before raising this 😞), if not I'm happy to open a PR that checks to see if the provided command ($0) is "npx" and warning, exiting 0/1.