Commit 0fdf1e6
authored
Fix hydrogen upgrade failing with yarn (#3462)
* Fix hydrogen upgrade failing with yarn
The upgrade command was using `installNodeModules` which always runs
`<pm> install <packages>`. This works for npm, pnpm, and bun but fails
for yarn which requires `add` instead of `install` when adding/upgrading
specific packages. Mirror the pattern already used by
`uninstallNodeModules` which correctly maps the subcommand per package
manager.
* Fix pnpm command mapping to use 'add' instead of 'install'
Use exhaustive per-PM branch pattern matching uninstallNodeModules()
to correctly map each package manager to its install subcommand.
pnpm requires 'add' for specific packages, not 'install'.
* Extract resolvePackageManagerName helper
Deduplicate the 'unknown' → 'npm' normalization logic shared
between upgradeNodeModules and uninstallNodeModules.
* docs: update changeset to mention both yarn and pnpm fix
* docs: add comment explaining why installNodeModules was replaced1 parent 5c41859 commit 0fdf1e6
File tree
2 files changed
+38
-11
lines changed- .changeset
- packages/cli/src/commands/hydrogen
2 files changed
+38
-11
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
23 | 23 | | |
24 | 24 | | |
25 | 25 | | |
26 | | - | |
27 | 26 | | |
28 | 27 | | |
29 | 28 | | |
| |||
979 | 978 | | |
980 | 979 | | |
981 | 980 | | |
982 | | - | |
| 981 | + | |
| 982 | + | |
| 983 | + | |
983 | 984 | | |
984 | 985 | | |
985 | 986 | | |
| |||
990 | 991 | | |
991 | 992 | | |
992 | 993 | | |
993 | | - | |
994 | | - | |
995 | | - | |
996 | | - | |
997 | | - | |
| 994 | + | |
| 995 | + | |
| 996 | + | |
| 997 | + | |
| 998 | + | |
| 999 | + | |
| 1000 | + | |
| 1001 | + | |
| 1002 | + | |
| 1003 | + | |
| 1004 | + | |
| 1005 | + | |
| 1006 | + | |
| 1007 | + | |
| 1008 | + | |
| 1009 | + | |
| 1010 | + | |
| 1011 | + | |
998 | 1012 | | |
999 | 1013 | | |
1000 | 1014 | | |
| |||
1004 | 1018 | | |
1005 | 1019 | | |
1006 | 1020 | | |
| 1021 | + | |
| 1022 | + | |
| 1023 | + | |
| 1024 | + | |
| 1025 | + | |
| 1026 | + | |
| 1027 | + | |
| 1028 | + | |
| 1029 | + | |
1007 | 1030 | | |
1008 | 1031 | | |
1009 | 1032 | | |
| |||
1029 | 1052 | | |
1030 | 1053 | | |
1031 | 1054 | | |
1032 | | - | |
1033 | | - | |
1034 | | - | |
1035 | | - | |
| 1055 | + | |
| 1056 | + | |
| 1057 | + | |
1036 | 1058 | | |
1037 | 1059 | | |
1038 | 1060 | | |
| |||
0 commit comments