browserslist / update-db

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

npx update-browserslist-db@latest is broken due to yarnpkg: command not found #27

Closed yangyang861115 closed 5 months ago

yangyang861115 commented 11 months ago

Hi, we noticed that npx update-browserslist-db@latest is broken after this PR in our yarn 3 based repo. Any reason it is using yarnpkg instead of yarn?

yarn: 3.2.1

/bin/sh: yarnpkg: command not found
/home/coder/.npm/_npx/2662cbd72e57abb6/node_modules/update-browserslist-db/cli.js:39
      throw e
      ^

Error: Command failed: yarnpkg npm info caniuse-lite --json
/bin/sh: yarnpkg: command not found
elwayman02 commented 11 months ago

It looks like this may be a bug in Volta, where the yarnpkg shim is not available: https://github.com/volta-cli/volta/issues/1391

ai commented 11 months ago

We are using yarnpkg because yarn CLI name is used in other DevOps tools.

If somebody has CLI autodection idea, please send PR.

elwayman02 commented 11 months ago

For anyone running across this issue, I think you can more or less run this command directly instead of relying on the update-db tool: yarn up -R caniuse-lite

mizziness commented 10 months ago

For anyone running across this issue, I think you can more or less run this command directly instead of relying on the update-db tool: yarn up -R caniuse-lite

I had to use yarn upgrade -R caniuse-lite because up wasn't recognized, but this worked for me; the warnings are finally gone! :)

mralaminahamed commented 5 months ago

@ai, I've submitted a pull request to address this matter. Could you please review pull request #32?

mralaminahamed commented 5 months ago

We are using yarnpkg because yarn CLI name is used in other DevOps tools.

If somebody has CLI autodection idea, please send PR.

I have added a new feature that detects the presence of yarn and hadoop installations in the current environment. It would be greatly appreciated if others could contribute by testing this new feature and providing feedback or suggestions for improvement.

PR: #34