Error: Command 'theme dev' not found.

Error: Command 'theme dev' not found.

samwell2024
New Member
4 0 0

I am trying to customize a theme locally. I am following these docs to preview my local changes: https://shopify.dev/docs/themes/getting-started/customize#step-5-preview-your-changes. I keep getting this error: Command 'theme dev' not found.

 

I am using Shopify CLI version 3.56.1 on Ubuntu Linux.

 

When I run the `shopify` command, this is what get printed to the terminal:

 

$ shopify
A CLI tool to build for the Shopify platform VERSION @shopify/cli/3.56.1 linux-x64 node-v20.11.1 USAGE $ shopify [COMMAND] TOPICS app Build Shopify apps. auth Auth operations. config Disable autocorrect. COMMANDS commands list all the commands help Display help for shopify. search Starts a search on shopify.dev. upgrade Upgrade the Shopify CLI. version Shopify CLI version.

Notice that there is no theme command listed in that output. I have tried uninstalling and reinstalling the Shopify packages (npm install -g @Shopify/cli @Shopify/theme) multiple times and I am still getting this error.

 

Am I supposed to install some dependencies first? I have seen some people mention running npm commands (e.g. npm install or npm run dev), but there is no package.json file to run npm commands. What am I doing wrong?

 

Thank you!

Replies 8 (8)

Liam
Shopify Staff
2807 310 805

Hi Sam,

 

If you run `shopify theme dev` when you're inside a theme project directory, does this work? The `npm` commands are all for app development, and the theme commands start with `shopify theme". 

Liam | Developer Advocate @ Shopify 
 - Was my reply helpful? Click Like to let me know! 
 - Was your question answered? Mark it as an Accepted Solution
 - To learn more visit Shopify.dev or the Shopify Web Design and Development Blog

samwell2024
New Member
4 0 0

Hi Liam,

 

I should have mentioned that I am running the `shopify theme dev` command inside my theme project's root directory when I get that error. 

 

If I run `shopify theme`, then this is what gets printed to the terminal:

 

 

Build Liquid themes.

USAGE
  $ shopify theme COMMAND

 

 

So even though the `shopify theme` command does not appear in the terminal output when I run the `shopify` command, the `shopify theme` command appears to still be available. But none of the subcommands under `shopify theme` are available.

 

If I run `shopify commands`, then this is what gets printed to the terminal:

 

 

 Command                   Summary                                       
 ───────────────────────── ───────────────────────────────────────────── 
 auth logout               Logout from Shopify.                          
 commands                  list all the commands                         
 config autocorrect off    Disable autocorrect.                          
 config autocorrect on     Enable autocorrect.                           
 config autocorrect status Check autocorrect current status.             
 help                      Display help for shopify.                     
 plugins add               Installs a plugin into the CLI.               
 plugins inspect           Displays installation properties of a plugin. 
 plugins install           Installs a plugin into the CLI.               
 plugins link              Links a plugin into the CLI for development.  
 plugins remove            Removes a plugin from the CLI.                
 plugins uninstall         Removes a plugin from the CLI.                
 plugins unlink            Removes a plugin from the CLI.                
 plugins update            Update installed plugins.                     
 search                    Starts a search on shopify.dev.               
 upgrade                   Upgrade the Shopify CLI.                      
 version                   Shopify CLI version.     

 

 

It looks like there are a lot of commands missing from that output when compared to the commands on this page: https://shopify.dev/docs/themes/tools/cli/commands.

 

It seems like this is either a bug with the Shopify CLI version that I am using or that it is a "Well, it works on my computer. Sorry." kind of a problem. Does Shopify maintain a Docker image that I can use for theme development? Maybe that will fix this issue.

 

Thank you!

Liam
Shopify Staff
2807 310 805

I think you might have different conflicting versions of the CLI installed. Are you running this on a windows machine?

Liam | Developer Advocate @ Shopify 
 - Was my reply helpful? Click Like to let me know! 
 - Was your question answered? Mark it as an Accepted Solution
 - To learn more visit Shopify.dev or the Shopify Web Design and Development Blog

samwell2024
New Member
4 0 0

No. I am using Shopify CLI version 3.56.2 on Ubuntu Linux. I have uninstalled Shopify CLI, removed all traces of it from my system, and reinstalled it. I am still getting that same error.

 

Does Shopify maintain a Docker image that I can use for theme development?

 

Thank you!

 

Marko-B
Shopify Partner
1 0 0

I have the same issue as Samwell2024, I am running this on Windows. 
I migrated from CLI 2 to 3.x today by updating all the prerequisites (Ruby+DevKit, Bundler, Node.js), and uninstalling and reinstalling Shopify CLI to the latest version. 
Everything related to errors listed, usable commands,  commands not founds are the same

samwell2024
New Member
4 0 0

Marko-B,

 

It looks like this request for help has gone the way of the dodo. The issue that I have reported is a bit of a deal breaker for me, so I am going to explore some other e-commerce platforms and integrate with my other business platforms through open APIs. I'll tell you what, Medusa.js looks pretty awesome! It's open source and modern. If you are a JavaScript developer, then it looks like you are in complete control of the code, data, etc.

 

Good luck!

Liam
Shopify Staff
2807 310 805

Hey Sam - your issue sounds a bit like this one, where an old and new version of the CLI were installed but the older version was loading for `shopify` commands. Even though you're running Ubuntu - could you try a similar strategy to fix - by identifying where the older version is being stored and removing it from your machine?

Liam | Developer Advocate @ Shopify 
 - Was my reply helpful? Click Like to let me know! 
 - Was your question answered? Mark it as an Accepted Solution
 - To learn more visit Shopify.dev or the Shopify Web Design and Development Blog

trexodore
Shopify Partner
3 0 0

Did you ever find a fix for this? I'm having the same issue