App reviews, troubleshooting, and recommendations
I'm trying to create a new Shopify app following the Create an app instructions in a repo using pnpm workspaces. The app fails to install dependencies when running `pnpm dev`. I've tried installing many different ways, but all of the errors have to do with the way the Shopify CLI tries to install while running the dev script, seemingly with both NPM and PNPM. It always fails on dependencies specifying `workspace:*` as the version.
Here's another example of an error:
── external error ──────────────────────────────────────────────────────────────
Error coming from `pnpm install`
Command failed with exit code 1: pnpm install
Scope: all 7 workspace projects
ENOENT ENOENT: no such file or directory, unlink
'/Users/<me>/Repos/my-turborepo/node_modules/@babel/core'
pnpm: ENOENT: no such file or directory, unlink
'/Users/<me>/Repos/my-turborepo/node_modules/@babel/core
^ Unlinking and re-installing babel/core leads to a chain of new errors involving installation.
Steps to reproduce
Easiest way to recreate the errors is to create a new monorepo with Turbo repo (guide)
npx create-turbo@latest
Then in the apps directory create a new Shopify app (guide)
pnpm create /app
Even though the Shopify CLI appears to support PNPM, this seems like a significant limitation and goes against emerging best practices for JS/TS application development as it prevents code sharing between projects. Any help resolving would be extremely appreciated.
I encountered this as well. The cli doesn't seem to install dependencies in a way that is compatible with pnpm workspaces. Fortunately there is an option to skip dependency installs when running shopify dev or shopify build: --skip-dependencies-installation.
So, as a workaround, I have this in my Shopify app's workspace within my monorepo:
// packages/shopify/package.json:
{
...
"packageManager": "pnpm@7.29.0",
"scripts": {
"build": "pnpm install && shopify app build --skip-dependencies-installation",
"dev": "pnpm install && shopify app dev --skip-dependencies-installation"
}
...
}
Are you ready to take your business to the next level? Look no further than the latest ...
By SarahF_Shopify Apr 15, 2024We’re keeping the ball rolling to make sure you’re always ahead of the game. So buckle ...
By JasonH Apr 8, 2024Portrait of Stephen positioned next to an image of planet Earth, with the Stephen's World ...
By JasonH Mar 18, 2024