Isolate the pnpm install from an outer workspace - #167
Merged
smnandre merged 1 commit intoSep 9, 2026
Merged
Conversation
`bin/playwright-install` runs `pnpm install` from its own server directory. When the consuming application is a pnpm workspace root (it has a `pnpm-workspace.yaml`), pnpm walks up the directory tree, adopts that root, and installs the application's own dependencies instead of `playwright`. The installer then fails at the `require.resolve('playwright')` verification step, and it overwrites the application's `pnpm-lock.yaml` in the process.
The fix passes `--ignore-workspace` and `--lockfile-dir <server directory>` to the pnpm install command. Both options are required: with either one alone, the install still resolves to the outer workspace root.
npm is not affected, and the browser install step (`pnpm exec playwright install`) needs no change once the local `node_modules` is correct. A regression test covers both the frozen and non-frozen lockfile branches.
Codecov Report✅ All modified and coverable lines are covered by tests. 📢 Thoughts on this report? Let us know! |
Member
|
Thank you very much @Kocal ❤️ |
Contributor
Author
|
Note that it may happens with Yarn Classic, Yarn Berry, and maybe npm as well |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
bin/playwright-installrunspnpm installfrom its own server directory. When the consuming application is a pnpm workspace root (it has apnpm-workspace.yaml), pnpm walks up the directory tree, adopts that root, and installs the application's own dependencies instead ofplaywright. The installer then fails at therequire.resolve('playwright')verification step, and it overwrites the application'spnpm-lock.yamlin the process.The fix passes
--ignore-workspaceand--lockfile-dir <server directory>to the pnpm install command. Both options are required: with either one alone, the install still resolves to the outer workspace root.npm is not affected, and the browser install step (
pnpm exec playwright install) needs no change once the localnode_modulesis correct. A regression test covers both the frozen and non-frozen lockfile branches.