Skip to content

Conversation

@umxr
Copy link
Contributor

@umxr umxr commented Feb 11, 2026

Summary

  • The hydrogen upgrade command was using installNodeModules() from cli-kit, which always runs <pm> install <packages>. This works for npm but fails for yarn, pnpm, and bun, which require add instead of install when adding/upgrading specific packages.
  • Replaced with a direct exec() call that maps the correct subcommand per package manager (install for npm, add for yarn/pnpm/bun), mirroring the pattern already used by uninstallNodeModules() in the same file.

Error before fix

Error coming from `yarn install @shopify/hydrogen@2025.7.1 react-router@7.12.0 ...`

Command failed with exit code 1: yarn install @shopify/hydrogen@2025.7.1 ...
error `install` has been replaced with `add` to add new dependencies.

Test plan

  • Existing upgradeNodeModules and buildUpgradeCommandArgs tests pass
  • Manual test: run shopify hydrogen upgrade in a yarn-based Hydrogen project
  • Manual test: run shopify hydrogen upgrade in an npm-based Hydrogen project (no regression)

@umxr umxr requested a review from a team as a code owner February 11, 2026 21:13
The upgrade command was using `installNodeModules` which always runs
`<pm> install <packages>`. This works for npm but fails for yarn, pnpm,
and bun which require `add` instead of `install` when adding/upgrading
specific packages. Mirror the pattern already used by
`uninstallNodeModules` which correctly maps the subcommand per package
manager.
@umxr umxr force-pushed the fix/yarn-upgrade-command branch from 9afba8b to 8404465 Compare February 11, 2026 21:15
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant