Install or upgrade Shopify CLI 2.x
This reference guide contains information about upgrading Shopify CLI, migrating from a legacy version, and uninstalling Shopify CLI.
Install Shopify CLI 2.x
Anchor link to section titled "Install Shopify CLI 2.x"If you need to, you can install Shopify CLI 2.x. You should only install Shopify CLI 2.x if you are continuing work on an existing app that hasn't been migrated to Shopify CLI 3.x, or if Shopify CLI 2.x is explicitly specified in the prerequisites for a feature.
You can install Shopify CLI 2.x on Windows, macOS, or Linux. Use your computer's command line to install Shopify CLI from one of the supported package managers.
Requirements
Anchor link to section titled "Requirements"- Ruby or Ruby+Devkit using RubyInstaller for Windows 2.7 or higher
- Git
- A Shopify Partner account
- A Shopify development store to install and test apps
You also need to install the following project-specific requirements:
If you want to use Shopify CLI natively on Windows 10, then first make sure that you've installed Ruby+Devkit using RubyInstaller for Windows (version 2.7 or higher).
Alternatively, you can use Shopify CLI using Windows Subsystem for Linux, in which case you need to install the following:
After you install the prerequisites, you can install Shopify CLI as a Ruby gem using the RubyGems.org package manager. In a new terminal window, navigate to your home directory and run the following command:
Shopify CLI is available for macOS through either RubyGems.org or Homebrew.
RubyGems.org
Anchor link to section titled "RubyGems.org"In a new terminal window, navigate to your home directory and run the following command:
You need to add Shopify's third-party repositories to Homebrew before you can install Shopify CLI.
Shopify CLI is available for Linux distributions through RubyGems.org, as well as through apt or yum.
RubyGems.org
Anchor link to section titled "RubyGems.org"In a new terminal window, navigate to your home directory and run the following command:
apt (Debian, Ubuntu)
Anchor link to section titled "apt (Debian, Ubuntu)"On Debian-based Linux systems, Shopify CLI is available to install with apt
.
- Download the latest Shopify CLI
.deb
file from the releases page on GitHub. Note the file’s location for the next step. Run the following command. Make sure to replace
/path/to/download/shopify-cli-x.y.z.deb
with the path to your file's location.
yum (CentOS 8+, Fedora, Red Hat, SUSE Linux)
Anchor link to section titled "yum (CentOS 8+, Fedora, Red Hat, SUSE Linux)"On RPM-based Linux systems, Shopify CLI is available to install with yum
.
- Download the latest Shopify CLI
.rpm
file from the releases page on GitHub. Note the file’s location for the next step. Run the following command. Make sure to replace
/path/to/download/shopify-cli-x.y.z.rpm
with the path to your file's location.
Verify the installation
Anchor link to section titled "Verify the installation"To verify that Shopify CLI 2.x is installed properly, run the following command:
The command returns a version number.
Upgrade Shopify CLI
Anchor link to section titled "Upgrade Shopify CLI"You can manage upgrades to Shopify CLI with the package manager for your platform. You must use the same package manager to upgrade that you originally used to install Shopify CLI.
For extension development, you might also need to update specific node modules manually to use all of the latest features.
Homebrew (macOS)
Anchor link to section titled "Homebrew (macOS)"
apt (Debian, Ubuntu)
Anchor link to section titled "apt (Debian, Ubuntu)"- Download the latest
.deb
file for Shopify CLI from the releases page. Install the downloaded file and make sure to replace
/path/to/download/shopify-cli-x.y.z.deb
with the path to your file's location:
yum (CentOS 8+, Fedora, Red Hat, SUSE)
Anchor link to section titled "yum (CentOS 8+, Fedora, Red Hat, SUSE)"- Download the latest
.rpm
file for Shopify CLI from the releases page. Install the downloaded file and make sure to replace
/path/to/downloaded/shopify-cli-x.y.x.rpm
with the path to your file's location.
RubyGems (macOS, Linux, Windows 10)
Anchor link to section titled "RubyGems (macOS, Linux, Windows 10)"
Update node modules for extension development
Anchor link to section titled "Update node modules for extension development"For extension development, you might also need to update specific node modules manually to use all of the latest features.
Post-purchase checkout extension
Anchor link to section titled "Post-purchase checkout extension"Uninstall the client library and command line tool:
Yarn (without React):
Yarn (if using React):
NPM (without React):
NPM (if using React):
Install the new client library:
Yarn (without React):
Yarn (if using React):
NPM (without React):
NPM (if using React):
Install the new command line tool:
Yarn:
NPM:
In your extension code, replace all references to the old client library with the new library:
- If you're using React, then replace
@shopify/argo-post-purchase-react
with@shopify/post-purchase-ui-extensions-react
. - If you're not using React, then replace
@shopify/argo-post-purchase
with@shopify/post-purchase-ui-extensions
.
- If you're using React, then replace
Update your scripts in
package.json
to use the newcheckout-ui-extensions-run
:
Product subscription app extension
Anchor link to section titled "Product subscription app extension"Uninstall the client library and command line tool:
Yarn (without React):
Yarn (if using React):
NPM (without React):
NPM (if using React):
Install the new client library:
Yarn (without React):
Yarn (if using React):
NPM (without React):
NPM (if using React):
Install the new command line tool:
Yarn:
NPM:
In your extension code, replace all references to the old client library with the new library:
- If you're using React, then replace
@shopify/argo-admin-react
with@shopify/admin-ui-extensions-react
. - If you're not using React, then replace
@shopify/argo-admin
with@shopify/admin-ui-extensions
.
- If you're using React, then replace
Update your scripts in
package.json
to use the newcheckout-ui-extensions-run
: