New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[Bug]: Shopify Cli install doesn't work #1610
Comments
Same here |
CONFIRMED. issue regarding node v19.8.0. just used the npm package way. same error with nvm version 19.8.0. If i switch back to lts which is v18.15.0 everything is working. Just switch for the brew package to node lts version. Should be smarter anyways... |
Same here. I've just updated the node to 19.8.0 and CLI stops working. |
Does anyone have a solution for this issue? |
I have installed node 18 with brew install node@18 and then i manually deleted the homebrew/Cellar/node folder and renamed the node@18 to node and renamed the inner folder from 18.15.0 to 19.8.0 and it worked for me. |
Same here, just upgraded to 3.0 today and I'm facing the issue described on this thread. |
I followed this and it worked for me. So dfefinitely an issue with node 19.9.0 |
A temporary workaround: $ brew uninstall shopify-cli
$ brew autoremove
$ brew cleanup
$ brew edit shopify-cli Then replace # frozen_string_literal: true
require "formula"
require "language/node"
require "fileutils"
class ShopifyCli < Formula
desc "A CLI tool to build for the Shopify platform"
homepage "https://github.com/shopify/cli#readme"
url "https://registry.npmjs.org/@shopify/cli/-/cli-3.44.1.tgz"
sha256 "00cb4f8cf75d843e22d425b3f5b0c0099a31f1f0e51351d7283793b9985c5a27"
license "MIT"
- depends_on "node"
+ depends_on "node@18"
depends_on "ruby"
depends_on "git"
resource "cli-theme-commands" do
url "https://registry.npmjs.org/@shopify/theme/-/theme-3.44.1.tgz"
sha256 "a4875c3f82630d5e1ab49bc772195355c00f9b2a621817a3ada651debd834db8"
end
livecheck do
url :stable
end
def install
existing_cli_path = `which shopify`
unless existing_cli_path.empty? || existing_cli_path.include?("homebrew")
opoo <<~WARNING
We've detected an installation of the Shopify CLI at #{existing_cli_path} that's not managed by Homebrew.
Please ensure that the Homebrew line in your shell configuration is at the bottom so that Homebrew-managed
tools take precedence.
WARNING
end
system "npm", "install", *Language::Node.std_npm_install_args(libexec)
original_executable_path = "#{libexec}/bin/shopify"
executable_path = "#{original_executable_path}"
FileUtils.move(original_executable_path, "#{executable_path}-original")
executable_content = <<~SCRIPT
- #!/usr/bin/env #{Formula["node"].opt_bin}/node
+ #!/usr/bin/env #{Formula["node@18"].opt_bin}/node
process.env.SHOPIFY_RUBY_BINDIR = "#{Formula["ruby"].opt_bin}"
process.env.SHOPIFY_HOMEBREW_FORMULA = "shopify-cli"
import("./shopify-original");
SCRIPT
File.write executable_path, executable_content
FileUtils.chmod("+x", executable_path)
bin.install_symlink executable_path
resource("cli-theme-commands").stage {
system "npm", "install", *Language::Node.std_npm_install_args(libexec)
}
end
def post_install
message = <<~POSTINSTALL_MESSAGE
Congratulations, you've successfully installed Shopify CLI 3!
Global installations of Shopify CLI 3 should only be used to work on Shopify
themes. To learn about the changes to theme workflows in this version, refer
to https://shopify.dev/themes/tools/cli/migrate#workflow-changes
If you want to keep using Shopify CLI 2, then you can install it again using
`brew install shopify-cli@2` and run commands using the `shopify2` program
name (for example, `shopify2 theme push` and `shopify2 extension push`).
Note however that Shopify CLI 2 will be sunset on May 31, 2023.
POSTINSTALL_MESSAGE
message.each_line { |line| ohai line.chomp }
end
end Save the file and then: $ brew install shopify-cli It will install Node.js 18 instead of 19. I think its better than editing manually internal paths of Homebrew because it can broke other tools using |
It looks like it was on the node side. I run the brew upgrade again today, it upgrades the node to 19.8.1. and now everything works well. |
As reported by @choogoor this was fixed with the latest node version. Reference to that here nodejs/node#47096. |
Please confirm that you have:
In which of these areas are you experiencing a problem?
Other
Expected behavior
Working Shopify Cli
Actual behavior
Some random node errors
Verbose output
Reproduction steps
Operating System
Mac OS Ventura 13.0.1 (Intel)
Shopify CLI version (check your project's
package.json
if you're not sure)3.44.1
Shell
zsh
Node version (run
node -v
if you're not sure)tried a lot, but i think doesnt matter because in the warning it says node v19.8.0 which comes with the brew package
What language and version are you using in your application?
No response
The text was updated successfully, but these errors were encountered: