browserslist / update-db

CLI tool to update caniuse-lite to refresh target browsers from Browserslist config
https://browsersl.ist/
MIT License
364 stars 70 forks source link

yarn vs yarnpkg #24

Closed bshender closed 1 year ago

bshender commented 1 year ago

I'm getting this error:

ERROR: info is not COMMAND nor fully qualified CLASSNAME.
/Users/bshender/.npm/_npx/2662cbd72e57abb6/node_modules/update-browserslist-db/cli.js:39
      throw e
      ^

Error: Command failed: yarn info caniuse-lite --json
ERROR: info is not COMMAND nor fully qualified CLASSNAME.

From this line: https://github.com/browserslist/update-db/blob/7ec485b186d8ae53dd4536fc0605a5073e6ee5c0/index.js#L62

The reason is that yarn is the name of the Hadoop command line tool. When the JS tool yarn came about the team wasn't aware of this. They have since created the built-in alias yarnpkg that avoids the name collision. Those of us who use both tools just use the alias and have few problems. And most command line tools don't have the issue, even those that call yarn, so long as you start them with yarnpkg. But that isn't the case here where we use npx. The fix is simple enough, if we could update all instances of yarn being called with the alias yarnpkg this problem should be addressed, and since the alias is built in to the yarn installer, it should be invisible to everyone. Try it on your machine, it's already there. Thank you.

ai commented 1 year ago

Can you send PR to save your name in the project history?

bshender commented 1 year ago

Unfortunately, my current employer is very strict about open source collaboration. I can open a request, but it would be several months at best, even though this one is basically just adding 3 letters in a couple places. If you or someone else would be able to make the fix before then that would be fine by me.

ai commented 1 year ago

Sure. Fixed 3f04a96