Global tools that depend on each other are not able to see each other
When globally installing @shopify/cli and @shopify/theme with volta (or npm while running volta) and running shopify theme, no subcommands are found.
Seems like it might be by design, as I understand volta kinda sandboxes all the tools. Is there a way to enter exceptions to the sandboxing? Can't use volta otherwise.
This message appears when you try to execute this command:
shopify theme init
? Command `theme init` not found. Did you mean `kitchen-sink async`?
I have the same problem.
I managed to escape this by installing local dependencies in the root folder and call shopify theme init like this:
-
mkdir shopify -
cd shopify -
yarn add @shopify/cli @shopify/theme -
./node_modules/@shopify/cli/bin/run.js theme initalso -
./node_modules/@shopify/cli/bin/run.js theme dev --store abc_theme.myshopify.com
So the folder structure will be like this:
-- abc_theme
-- node_modules
-- package.json
-- yarn.lock
Another thing, I have compared the global packages in this path:
/home/nadhir/.volta/tools/shared/@shopify/cli
/home/nadhir/.volta/tools/shared/@shopify/theme
And the local packages:
/home/nadhir/shopify/node_modules/@shopify/cli
/home/nadhir/shopify/node_modules/@shopify/theme
I found that they are the same, as meld software said.
I want to find if the @shopify/cli package calling @shopify/theme in somewhere... then change it to call theme with the right path.
Solutions to this problem:
- Deactivate
volta, and letyarnornpmto manageglobalpackages. - Improve
@shopify/clito search for@shopify/themeifvoltais installed.
Test 1:
- Try to uninstall
voltathen installyarnassystem app, then install@shopifyasglobal, then re-installvolta.
I faced this problem yesterday. I'm new to Shopify Dev, And I do not have much time to find solution to this problem right now. because the local solution works for me.
My Regards.