[rush-lib] Fix pnpm-sync caused .modules.yaml ENOENT during install#5259
Merged
octogonz merged 3 commits intomicrosoft:mainfrom Jun 23, 2025
Merged
[rush-lib] Fix pnpm-sync caused .modules.yaml ENOENT during install#5259octogonz merged 3 commits intomicrosoft:mainfrom
octogonz merged 3 commits intomicrosoft:mainfrom
Conversation
octogonz
reviewed
Jun 23, 2025
| if (this.rushConfiguration.isPnpm && experiments?.usePnpmSyncForInjectedDependencies) { | ||
| const pnpmLockfilePath: string = subspace.getTempShrinkwrapFilename(); | ||
| const dotPnpmFolder: string = `${subspace.getSubspaceTempFolderPath()}/node_modules/.pnpm`; | ||
| const modulesFilePath: string = `${subspace.getSubspaceTempFolderPath()}/node_modules/.modules.yaml`; |
Collaborator
There was a problem hiding this comment.
Ideally pnpm-sync-lib should export this as a constant. But it's not essential.
octogonz
approved these changes
Jun 23, 2025
Collaborator
|
Thanks for fixing this! |
Contributor
Author
|
@octogonz could you also help run a release for |
Collaborator
|
@harttle Rush 5.155.1 has been published 🚀 |
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.
Summary
Fixes #5201
During
rush install, after callingpnpm install, for repos with injected dependencies enabled, rush calls pnpm-sync.pnpm-sync then tries to read
.modules.yamlduringpnpmSyncPrepareAsync(), but this file sometimes doesn't exist, causingrush installto fail.pnpm itself treats it as a special case and doens't throw when this file not eixst during
readModulesManifest()andwriteModulesManifest(): https://github.com/pnpm/pnpm/blob/5d2308c9aad8b2a7e96721a13845f21e86038619/pkg-manager/modules-yaml/src/index.ts#L45Details
Adding one more check for the file before calling
pnpmSyncPrepareAsync().How it was tested
node libraries/rush-lib/lib-commonjs/start.js installasrush install