npx doesn't fast-path on Windows

This can be readily demonstrated with:

npm i -D figlet-cli
npx figlet

You’ll note that A) it takes a few seconds to run figlet in that case and B) that the line “npx: installed 1 in 3.162s” (or some such) will be on screen.

Some things of note:

  1. The bin provided by figlet-cli is named figlet.
  2. There is a module named figlet but it doesn’t provide a cli.

It would seem that npx is not recognizing .cmd files as being executable. it’s also likely that if it did, it wouldn’t be using read-cmd-shim to find the actual JS for the super fast path.

Many thanks to @rpamely on Twitter for digging through this with me.

This topic was automatically closed 90 days after the last reply. New replies are no longer allowed.