Creating embed app with shopify cli throws an error

Topic summary

Issue: Generating a Shopify embedded app extension (admin_action) via the CLI (command-line interface) fails when run through npm.

  • Command used: npm run shopify app generate extension – --template admin_action --name issue-tracker-action --flavor react
  • Environment: Shopify CLI 3.58.2, darwin-arm64, Node v21.7.2.
  • Error: npm ERR! Missing script: “shopify”; npm suggests running npm run to list available scripts.

Context: The error indicates npm is looking for a “shopify” script in package.json that doesn’t exist. The user reports trying multiple online solutions without success.

Outcome/Status: No fix or workaround confirmed in the thread. The issue remains unresolved and assistance is requested.

Summarized with AI on January 1. AI used: gpt-5.

Hello,

What i am using is:

npm run shopify app generate extension -- --template admin_action --name issue-tracker-action --flavor react

what I get is:

npm ERR! Missing script: "shopify"
npm ERR! 
npm ERR! To see a list of scripts, run:
npm ERR!   npm run

My shopify cli version:

/cli/3.58.2 darwin-arm64 node-v21.7.2

Literally tried every solution that can be found in google and really dont know what to do anymore.