Open WebEferen opened 1 year ago
Turns out that commenting this line and applying diff allows usage of multiple the same aliases because the implementation is based on Map (so anyway it won't have a duplicate) - will open a PR with such change.
Which package manager are you using? Is useWorkspaces
enabled?
@iclanton useWorkspaces is not enabled. I was using npm (version 9.2.x)
It happened to me, too. When will it be fixed
Turns out that commenting this line and applying diff allows usage of multiple the same aliases because the implementation is based on Map (so anyway it won't have a duplicate) - will open a PR with such change.
Were you able to raise that PR? I am facing the same issue, and am not able to proceed. Is there any way that these changes can be reflected sooner? Using rush 5.100.1, yarn: 1.22.4, node: 18.17.0; Error is: Child already exists: string-width
It happened to me, too. When will it be fixed
package.json contains lerna@5.1.4 which causes this error
We no longer actively maintain the code path for useWorkspaces=false
, because the Rush maintainers' monorepos are all using useWorkspaces=true
now.
Is there a reason why you can't switch to useWorkspaces=true
? It is a better design that eliminates a lot of problems.
(Of course if someone wants to contribute a PR to improve the useWorkspaces=false
behavior, that would be great.)
same...
Summary
Rush update fails during linking process. It prints error: ERROR: Child already exists: (package-name)
Repro steps
Use npm alias with scoped packages in both applications:
"package-name": "npm:@scoped/package-name@latest"
Expected result: Packages will be linked correctly
Actual result: ERROR: Child already exists (package-name)
Details
During migration into rush, several packages were moved and they were working fine. Two of the migrated packages contains the same npm aliases (let's call it package-name). With those packages migrated, rush update stopped working after shrinkwrap step (packages without npm links were linked successfully but the ones with aliases failed.
Found similar issues here: https://github.com/microsoft/rushstack/issues/1279 (two last comments)
The line which is throwing error is attached below. My assumption is that the applied logic is wrong and when we spot that the package already exists, we should return without throwing error as it is right now in normally listed packages.
https://github.com/microsoft/rushstack/blob/2c1ffc5b40ad2164fe147aef65d0f348778e8a3a/libraries/rush-lib/src/logic/base/BasePackage.ts#L190
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
)?