App development

Shopify CLI says "Unknown package manager" on shopify app init: the fix

If you installed Shopify CLI with Homebrew, shopify app init stops with "Unknown package manager". One flag fixes it, and here is why the CLI gets confused in the first place.

Bas Lefeber

Founder, learnshopify.dev

Published
Reading time
3 min read

Shopify app development path

Learn to build Shopify apps by building a real one.

One app, built end to end on your own development store, with the fundamentals explained as you go. The first 15 lessons are free.

Start the path →
One way of installing the CLI leaves it no clue which package manager you use.

Add the package manager to the command:

bash
shopify app init --package-manager npm

That is the whole fix. -d npm does the same thing, and you can set SHOPIFY_FLAG_PACKAGE_MANAGER=npm in your shell if you would rather not type it. The flag accepts npm, yarn, pnpm and bun. Pick the one you have installed.

Who gets this

People who installed Shopify CLI with brew install shopify-cli and run shopify app init without the flag. Checked on 6 October 2026 against Shopify CLI 4.8.4, which is the latest release on npm and the version Homebrew installs today. The same code is in 3.94.3.

Why the CLI does not know

When shopify app init scaffolds your app, it edits package.json and installs dependencies, so it has to pick a package manager first. It asks four questions, in this order, and stops at the first answer it gets:

  1. Did you pass --package-manager? Use that.
  2. Is the npm_config_user_agent environment variable set? npm, pnpm, yarn and bun set it when they launch a command for you, for example through npx or npm exec. Use that.
  3. How was the CLI itself installed? If its path sits inside Homebrew's Cellar folder, the answer is "homebrew".
  4. Anything else: npm.

A Homebrew install never goes through a package manager, so question 2 comes back empty and question 3 answers "homebrew". Homebrew cannot install a JavaScript project's dependencies, so the scaffolding step that edits package.json gives up. It treats "homebrew" and "unknown" the same way and throws the same message: Unknown package manager.

How the CLI was installedWhat init picksResult
Homebrew (brew install shopify-cli)homebrewUnknown package manager
Global install with npm, yarn or pnpmThe one that installed itWorks
Run through npx or similarRead from the user agentWorks
Any of the above, with --package-managerWhatever you passedWorks
The flag wins over everything else, which is why it fixes the Homebrew case.

The CLI even tells you where the flag lives. Right before it starts scaffolding it prints the package manager it chose and the line "Use the --package-manager flag to select a different package manager."

Keep Homebrew or switch

Both installs are documented by Shopify, and the error only shows up in app init. If you like Homebrew, keep it and add the flag whenever you scaffold a new app. You do that a handful of times a year.

If you would rather not remember the flag, install the CLI with npm instead. Shopify's docs list this as the first option, and it needs Node.js 22.12 or higher:

bash
npm install -g @shopify/cli@latestbrew uninstall shopify-cli

Uninstall the Homebrew copy in the same go. Two copies on one machine is the next problem you will hit, and it is a quiet one.

Check you only have one copy

Run this and count the lines:

bash
which -a shopifyshopify version

On the Mac this post was checked on, which -a shopify listed three copies: one from Homebrew and one under each of two Node versions managed with nvm. Two of them were 4.8.4 and the third was 3.94.3. Your terminal runs whichever comes first in your PATH, and shopify version tells you which one that is. A command that exists in 4.x, such as shopify store create dev, is answered with "Command store:create:dev not found." when the 3.94.3 copy runs.

After the scaffold

The flag only matters for the scaffold. Once the app exists, the CLI looks for a lockfile in your project before it asks anything else, and you start the dev server the usual way:

bash
cd my-appshopify app dev

When that app needs to leave your laptop, this post covers the config lines that change.

Learning Shopify app development with AI writing the code?

The path teaches the fundamentals. Start the Shopify app development path.

Frequently asked questions

What does "Unknown package manager" mean in Shopify CLI?

The CLI could not work out which package manager to use for the new app, so it stopped while scaffolding. It happens when Shopify CLI was installed with Homebrew and shopify app init runs without a --package-manager flag. Homebrew cannot install JavaScript dependencies, so the CLI has nothing to fall back on.

How do I fix Unknown package manager on shopify app init?

Run shopify app init --package-manager npm. The short form is -d npm, and the environment variable SHOPIFY_FLAG_PACKAGE_MANAGER=npm does the same thing. The flag accepts npm, yarn, pnpm and bun.

Which package managers does shopify app init support?

The --package-manager flag accepts npm, yarn, pnpm and bun. Shopify's CLI requirements page lists npm, Yarn 1.x and pnpm, so npm is the safe choice if you have no preference.

Should I install Shopify CLI with Homebrew or npm?

Both are documented by Shopify. Homebrew works fine except that shopify app init needs the --package-manager flag. Installing with npm install -g @shopify/cli@latest avoids the flag and needs Node.js 22.12 or higher. Whichever you pick, keep only one copy on your machine.

Why does shopify store create dev say the command is not found?

Usually an older Shopify CLI is answering. Run which -a shopify to see every copy on your PATH and shopify version to see which one runs first. Remove or upgrade the old one so a single 4.x copy is left.

  • app-development
  • shopify-cli
  • troubleshooting

About the author

Bas Lefeber, Founder, learnshopify.dev

Bas builds learnshopify.dev, where developers learn production-grade Shopify theme development against a live storefront. He writes about Liquid, theme architecture, and the parts of the job that still matter now that AI writes the code.

Keep going in the curriculum

Shopify app development path

Learning Shopify app development with AI writing the code?

The path teaches the fundamentals. You build one real app, end to end, on your own development store, so you understand what the AI wrote and can steer it. The first 15 lessons are free.