cli: [Bug]: Shopify CLI is broken by latest version of flori/json (v2.7.1) "[LoadError] cannot load such file -- json"
Please confirm that you have:
- Searched existing issues to see if your issue is a duplicate. (If you’ve found a duplicate issue, feel free to add additional information in a comment on it.)
- Reproduced the issue in the latest CLI version.
In which of these areas are you experiencing a problem?
Theme
Expected behavior
After authenticating, the CLI should be able to retrieve theme files using shopify theme pull
Actual behavior
It fails with the error below, despite the CLI not having been modified locally in any way.
Verbose output
$ shopify theme pull
[Note] You cannot use gems with Shopify CLI.
[LoadError] cannot load such file -- json
They are disabled.
Please don't modify the CLI locally.
If you would like to contribute to the CLI project, please refer to
https://github.com/Shopify/shopify-cli/blob/main/.github/CONTRIBUTING.md
[Note] You cannot use gems with Shopify CLI.
[LoadError] cannot load such file -- json
They are disabled.
Please don't modify the CLI locally.
If you would like to contribute to the CLI project, please refer to
https://github.com/Shopify/shopify-cli/blob/main/.github/CONTRIBUTING.md
[Note] You cannot use gems with Shopify CLI.
[LoadError] cannot load such file -- json
They are disabled.
Please don't modify the CLI locally.
If you would like to contribute to the CLI project, please refer to
https://github.com/Shopify/shopify-cli/blob/main/.github/CONTRIBUTING.md
~/.local/lib/node_modules/@shopify/theme/node_modules/@shopify/cli-kit/assets/cli-ruby/bin/shopify:9:in `require': cannot load such file -- json (LoadError)
from ~/.local/lib/node_modules/@shopify/theme/node_modules/@shopify/cli-kit/assets/cli-ruby/bin/shopify:9:in `require'
from ~/.local/lib/node_modules/@shopify/theme/node_modules/@shopify/cli-kit/assets/cli-ruby/lib/shopify_cli/context.rb:6:in `<top (required)>'
from ~/.local/lib/node_modules/@shopify/theme/node_modules/@shopify/cli-kit/assets/cli-ruby/bin/shopify:9:in `require'
from ~/.local/lib/node_modules/@shopify/theme/node_modules/@shopify/cli-kit/assets/cli-ruby/bin/shopify:9:in `require'
from ~/.local/lib/node_modules/@shopify/theme/node_modules/@shopify/cli-kit/assets/cli-ruby/lib/shopify_cli.rb:133:in `<module:ShopifyCLI>'
from ~/.local/lib/node_modules/@shopify/theme/node_modules/@shopify/cli-kit/assets/cli-ruby/lib/shopify_cli.rb:42:in `<top (required)>'
from ~/.local/lib/node_modules/@shopify/theme/node_modules/@shopify/cli-kit/assets/cli-ruby/bin/shopify:9:in `require'
from ~/.local/lib/node_modules/@shopify/theme/node_modules/@shopify/cli-kit/assets/cli-ruby/bin/shopify:9:in `require'
from ~/.local/lib/node_modules/@shopify/theme/node_modules/@shopify/cli-kit/assets/cli-ruby/bin/load_shopify.rb:18:in `<top (required)>'
from ~/.local/lib/node_modules/@shopify/theme/node_modules/@shopify/cli-kit/assets/cli-ruby/bin/shopify:45:in `require_relative'
from ~/.local/lib/node_modules/@shopify/theme/node_modules/@shopify/cli-kit/assets/cli-ruby/bin/shopify:45:in `<main>'
Reproduction steps
- Install all dependencies as per https://shopify.dev/docs/themes/tools/cli/install
- Install Shopify CLI using
npm install -g @shopify/cli @shopify/theme - Verfiy using
shopify version - Attempt to retrieve theme files with
shopify theme pull(authenticate if required)
Operating System
Arch Linux
Shopify CLI version (check your project’s package.json if you’re not sure)
3.55.1
Shell
bash
Node version (run node -v if you’re not sure)
v21.6.1
What language and version are you using in your application?
Liquid
About this issue
- Original URL
- State: closed
- Created 3 years ago
- Comments: 20 (6 by maintainers)
This issue is still relevant
@gil-roboute we’re working to remove Ruby as a dependency in the CLI, I appreciate the patience for now 🙏
I’m facing this exact issue on Arch Linux (same versions as above).
Downgrading flori/json from 2.7.1 to 2.6.3 fixes it.
That’s this package on Arch (working version is 2.6.3-1).
The issue was raised here in Jan: https://github.com/Shopify/cli/issues/3221
👋 Thank you, everyone, for reporting! I’m closing the issue as Ruby is no longer required to run the latest version of Shopify CLI.