Closed mo closed 5 years ago
I just read the npx man page and realized that I had misunderstood how npx works. I always thought you typed "npx foo" to execute the main cli script from package named "foo" but in reality it seems that "npx foo" means run "foo" if it exists on the $PATH, otherwise try to guess what package "foo" comes from, install that and run the "foo" binary from that. In light of that, the correct invocation is:
npx -p @babel/cli -p @babel/core babel SOME PARAMS HERE
Even if there is a binary called "cli" on the $PATH, why would it be executed when I do "npx @babel/cli" ?