Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Compatibility with rush monorepo #20

Open
nickiaconis opened this issue Aug 2, 2023 · 2 comments
Open

Compatibility with rush monorepo #20

nickiaconis opened this issue Aug 2, 2023 · 2 comments

Comments

@nickiaconis
Copy link

I'm attempting to resolve the warning that caniuse-lite is out of date in a monorepo managed with rush. I'm using the command pnpm dlx update-browserslist-db@latest since I'm using pnpm. Individual packages are defined by repo_root/packages/package_name/package.json. The lockfile is global in rush managed monorepos though; it lives at repo_root/common/config/rush/pnpm-lock.yaml.

When I attempt to run the update command in one of the package's directory (e.g. repo_root/packages/package_A), I receive the following error stating no lockfile can be found:

pnpm dlx update-browserslist-db@latest
.../Library/pnpm/store/v3/tmp/dlx-67755 | +3 +
.../Library/pnpm/store/v3/tmp/dlx-67755 | Progress: resolved 3, reused 2, downloaded 1, added 3, done
 WARN  Issues with peer dependencies found
.
└─┬ update-browserslist-db 1.0.11
└── ✕ missing peer browserslist@">= 4.21.0"
Peer dependencies that should be installed:
browserslist@">= 4.21.0"
update-browserslist-db: No lockfile found. Run "npm install", "yarn install" or "pnpm install"

 ERROR  Command failed with exit code 1: /Users/niaconis/Library/pnpm/store/v3/tmp/dlx-67755/node_modules/.bin/update-browserslist-db

When I attempt to run the update command in the location of the lockfile (or in the repository root), I receive the following error stating package.json can't be found:

pnpm dlx update-browserslist-db@latest
../Library/pnpm/store/v3/tmp/dlx-72074 | +3 +
 WARN  Issues with peer dependencies found
.
└─┬ update-browserslist-db 1.0.11
└── ✕ missing peer browserslist@">= 4.21.0"
Peer dependencies that should be installed:
browserslist@">= 4.21.0"

../Library/pnpm/store/v3/tmp/dlx-72074 | Progress: resolved 3, reused 3, downloaded 0, added 3, done
update-browserslist-db: Cannot find package.json. Is this the right directory to run npx update-browserslist-db in?
 ERROR  Command failed with exit code 1: /Users/niaconis/Library/pnpm/store/v3/tmp/dlx-72074/node_modules/.bin/update-browserslist-db

How does one run update-browserslist-db in a monorepo environment where package.json and pnpm-lock.yaml are stored in different locations?

@ai
Copy link
Member

ai commented Aug 2, 2023

You don’t really need this tool for pnpm since pnpm has a great internal dependencies update tool. Just call in the root:

pnpm update caniuse-lite -r

@ai
Copy link
Member

ai commented Aug 2, 2023

If you know how to improve our lick file detector, please send PR

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants