You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
We encountered a bug where rush install sometimes prints this error:
ERROR: Cannot get dependency key for temp project: @rush-temp/new-project
Error: Cannot get dependency key for temp project: @rush-temp/new-project
at PnpmLinkManager._linkProject (C:\Users\Owner\.rush\node-v14.15.3\rush-5.36.2\node_modules\@microsoft\rush-lib\lib\logic\pnpm\PnpmLinkManager.js:132:19)
at PnpmLinkManager._linkProjects (C:\Users\Owner\.rush\node-v14.15.3\rush-5.36.2\node_modules\@microsoft\rush-lib\lib\logic\pnpm\PnpmLinkManager.js:69:28)
at async PnpmLinkManager.createSymlinksForProjects (C:\Users\Owner\.rush\node-v14.15.3\rush-5.36.2\node_modules\@microsoft\rush-lib\lib\logic\base\BaseLinkManager.js:189:9)
at async PnpmLinkManager.createSymlinksForProjects (C:\Users\Owner\.rush\node-v14.15.3\rush-5.36.2\node_modules\@microsoft\rush-lib\lib\logic\pnpm\PnpmLinkManager.js:58:9)
at async RushInstallManager.postInstallAsync (C:\Users\Owner\.rush\node-v14.15.3\rush-5.36.2\node_modules\@microsoft\rush-lib\lib\logic\installManager\RushInstallManager.js:492
Repro steps
Add a new project to an existing monorepo, and update another project to depend on it.
Run rush install. This operation completes successfully. The new project is added to common/temp/pnpm-lock.yaml. But note that it is NOT added to common/config/rush/pnpm-lock.yaml.
Run rush install a second time. This time it fails with the above error.
Running rush update does NOT fix the problem. But rush update --recheck does fix the problem.
Details
My theory is that it's incorrect for step 2 to skip updating common/config/rush/pnpm-lock.yaml.
Standard questions
Please answer these questions to help us investigate your issue more quickly:
Question
Answer
@microsoft/rush globally installed version?
5.36.2
rushVersion from rush.json?
5.36.2
useWorkspaces from rush.json?
false
Operating system?
Windows -->
Would you consider contributing a PR?
Yes -->
Node.js version (node -v)?
The text was updated successfully, but these errors were encountered:
@sachinjoseph FYI looks like this was a regression introduced by PR #1367. That PR improved the installation logic so that instead of calculating the temp project folder path (sometimes incorrectly), Rush now queries it from the PNPM shrinkwrap file -- which assumes that every Rush project must appear in the shrinkwrap file. That seems like a reasonable assumption, but actually the original implementation did not have this requirement, and (due to NPM's extremely long installation times back then) it was worthwhile to skip installation for that edge case. We can eliminate that optimization now, though.
I think the fix is to expand _findOrphanedTempProjects() to check for missing entries. I can make a PR to do that.
Unfortunately this doesn't explain @WanderWang's related-seeming issue from the chat room, since he is using PNPM workspaces, which does not invoke rush link.
Summary
We encountered a bug where
rush install
sometimes prints this error:Repro steps
rush install
. This operation completes successfully. The new project is added tocommon/temp/pnpm-lock.yaml
. But note that it is NOT added tocommon/config/rush/pnpm-lock.yaml
.rush install
a second time. This time it fails with the above error.Running
rush update
does NOT fix the problem. Butrush update --recheck
does fix the problem.Details
My theory is that it's incorrect for step 2 to skip updating
common/config/rush/pnpm-lock.yaml
.Standard questions
Please answer these questions to help us investigate your issue more quickly:
@microsoft/rush
globally installed version?rushVersion
from rush.json?useWorkspaces
from rush.json?node -v
)?The text was updated successfully, but these errors were encountered: