Shopify CLI commands fail locally with “Command failed with exit code 5: bundle install,” blocking theme development. Screenshots of the error were attached. “bundle install” is the Ruby dependency installer used by the CLI.
Tried and mixed results:
Running CMD/VS Code as Administrator did not help for several users.
On macOS, updating Homebrew and reinstalling Xcode Command Line Tools resolved the issue for one user.
Key Windows 10 resolution reported:
A bug in Shopify CLI v3.60.1 caused the failure. Uninstalling the CLI and installing an older version (v3.51.1) fixed it: uninstall @shopify/cli and @shopify/theme globally, then install v3.51.1 of both.
Other potential cause:
Windows username path containing spaces (e.g., C:\Users\First Last) broke paths; using a username without spaces resolved it for one user.
Status and open questions:
Multiple workarounds exist (macOS toolchain refresh, Windows CLI downgrade, avoid spaces in user path). No single root cause accepted across platforms.
A final question asks which Ruby version is in use, suggesting Ruby environment may be relevant. Discussion appears ongoing.
Summarized with AI on December 27.
AI used: gpt-5.
Hi, I’m trying to set up a local development environment for the Shopify theme. I’ve installed all the necessary files. whenever I run CMD so I get this error (command failed with exit code 5: bundle install error how to solve this). with every kind of Shopify command. you can see the error image below for a better understanding.
Ok, I managed to solve it. And “do the window” definitely was a red herring. It has got nothing to do with Windows. The main cause of the problem was that the latest version of Shopify/cli had a bug that caused this issue. (3.60.1 as of the time of writing)
For anyone looking for a solution on Windows 10, this is how I fixed it.
Uninstall Shopify CLI by running the command npm uninstall -g @Shopify_77 /cli @Shopify_77 /theme and then installing an older version of the Shopify CLI (3.51.1 worked for me) npm install -g @Shopify_77 /cli@3.51.1 @Shopify_77 /theme@3.51.1
Everything should work after the install. This took me a whole day to figure out what went wrong. I hope this helps.
so guys finally i got the solution the error coms from your username cous your username with space exampel C:\Users\hamdi ben bechir the solution is C:\Users\hamdibenbechir thank me later