[Bug]: Extension install fails in monorepo due to insufficient package manager detection #4028
Closed
2 tasks done
Labels
Type: Bug
Something isn't working
Please confirm that you have:
In which of these areas are you experiencing a problem?
Extension
Expected behavior
Running
shopify generate extension
in an app folder inside a monorepo should work fine. It should scaffold the extension, and install new dependencies using the correct package manager.Actual behavior
When creating extensions, during "Installing dependencies ..." the CLI will error out with:
The CLI did not correct the right package manager (see "Reproduction steps" below). Expected
pnpm
, butnpm
was used as a fallback.Looks like the internal
getPackageManager(fromDirectory)
tries to check for local lockfiles, but in a monorepo, that would only be found at the root repo directory, but not in the nested app/package directory.Possible solutions(?):
app build
andapp dev
via--skip-dependencies-installation
app init
via--package-manager
Verbose output
... [DATETIME]: Reading the content of file at package.json... [DATETIME]: Obtaining the dependency manager in directory /path/to/repo/apps/my-shopify-app... [DATETIME]: Reading the content of file at package.json... ...
Reproduction steps
Sample monorepo project setup:
Sample step:
cd apps/my-shopify-app
shopify generate extension
Checkout UI
, and follow the remaining promptsOperating System
Multi platform
Shopify CLI version (check your project's
package.json
if you're not sure)v3.61.2
Shell
No response
Node version (run
node -v
if you're not sure)v20.11.1
What language and version are you using in your application?
No response
The text was updated successfully, but these errors were encountered: