-
Notifications
You must be signed in to change notification settings - Fork 233
Open
Description
Problem
installNodeModules() in packages/cli-kit/src/public/node/node-package-manager.ts always runs <pm> install <packages>, but yarn and pnpm require add instead of install when adding specific packages with version specifiers.
This caused hydrogen upgrade to fail on yarn projects, and would similarly fail on pnpm.
Current behavior
let args = ['install']
if (options.args) {
args = args.concat(options.args)
}
await exec(options.packageManager, args, execOptions)This produces commands like:
yarn install @shopify/hydrogen@2025.7.1— fails (installhas been replaced withadd)pnpm install @shopify/hydrogen@2025.7.1— fails (pnpm installinstalls from lockfile, not specific packages)
Expected behavior
When specific packages are passed via args, the correct subcommand should be used per package manager:
| Package Manager | Correct Subcommand |
|---|---|
| npm | install |
| yarn | add |
| pnpm | add |
| bun | install |
Workaround
Shopify/hydrogen#3462 bypassed installNodeModules() with a direct exec() call that maps the correct subcommand per package manager. Once this upstream fix lands, that workaround can be removed.
References
- Hydrogen PR with workaround: Fix hydrogen upgrade failing with yarn hydrogen#3462
- Review comment requesting this issue: Fix hydrogen upgrade failing with yarn hydrogen#3462 (comment)
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels
Type
Fields
Give feedbackNo fields configured for issues without a type.