Running npx browserslist@latest --update-db in the project root:
npx: installed 5 in 1.579s
Current version: 1.0.30001154
New version: 1.0.30001154
Removing old caniuse-lite from lock file
Installing new caniuse-lite version
$ yarn add caniuse-lite
error Running this command will add the dependency to the workspace root rather than the workspace itself, which might not be what you want - if you really meant it, make it explicit by running this command again with the -W flag (or --ignore-workspace-root-check).
Error: Command failed: yarn add caniuse-lite
error Running this command will add the dependency to the workspace root rather than the workspace itself, which might not be what you want - if you really meant it, make it explicit by running this command again with the -W flag (or --ignore-workspace-root-check).
Running npx browserslist@latest --update-db inside a workspace:
npx: installed 5 in 1.576s
No lockfile found. Run "npm install", "yarn install" or "pnpm install"
Note: this isn't necessary anymore after https://github.com/browserslist/browserslist/pull/553
npx browserslist@latest --update-db in the project root, let it failyarn add caniuse-lite && yarn remove caniuse-lite inside the workspaceCan you send a PR? I will not have time for Browserslist during this month.
It's basically the matter of adding -W to the install script if it's yarn here: https://github.com/browserslist/browserslist/blob/6e1fc4cf93ad6ec128650dc3b7d2a670a375234d/update-db.js#L140
Not quite sure what happens with -W if the project isn't a workspace though, so that'd need to be tested.
If no one has created a PR when I get off work in 8 hours I could add it.
Adding -W doesn't break if you're not inside a workspace. Just tested it:
~/Development/nay => yarn add -W caniuse-lite
yarn add v1.22.10
[1/5] Validating package.json...
[2/5] Resolving packages...
[3/5] Fetching packages...
[...]
[4/5] Linking dependencies...
[5/5] Building fresh packages...
success Saved lockfile.
success Saved 1 new dependency.
info Direct dependencies
鈹斺攢 [email protected]
info All dependencies
鈹斺攢 [email protected]
Done in 3.05s.
~/Development/nay => yarn remove -W caniuse-lite
yarn remove v1.22.10
[1/2] Removing module caniuse-lite...
[2/2] Regenerating lockfile and installing missing dependencies...
[...]
success Uninstalled packages.
Done in 3.03s.
The fix was released in 4.14.7
Most helpful comment
Adding
-Wdoesn't break if you're not inside a workspace. Just tested it: