没有不值得去解决的问题,也没有不值得去学习的技术!

When Running: npm run shopify version, It Prompts: Running This Command Will Add the Dependency to the Workspace Root Rather Than the Workspace Itself

When running the command: npm run deploy, an error occurred: Upgrade your CLI version to run the deploy command. It prompted that the CLI version needed to be upgraded

1. When running the command: npm run deploy, an error occurred: Upgrade your CLI version to run the deploy command. It prompted that the CLI version needed to be upgraded. See Figure 1.

When running the command: npm run deploy, an error occurred: Upgrade your CLI version to run the deploy command. It prompted that the CLI version needed to be upgraded
Figure 1
Plaintext
wangqiang@DESKTOP-QLPK8QM:/mnt/e/wwwroot/shopify-app/learn-php-app-0605-prod$ npm run deploy

> learn-php-app-ubuntu-2004-0605@1.0.0 deploy
> shopify app deploy

?  Make the following changes to your extensions in Shopify Partners?
✔  Yes, deploy to push changes

Deploying your work to Shopify Partners. It will be part of learn-php-app-0605-prod

theme_extensions │ Running theme check on your Theme app extension...
theme_extensions │ Checking /mnt/e/wwwroot/shopify-app/learn-php-app-0605-prod/extensions/theme-app-extension-0612 ...
theme_extensions │ 4 files inspected, 0 offenses detected, 0 offenses auto-correctable

╭─ error ────────────────────────────────────────────────────────────────────────────────────────────────────────╮
│                                                                                                                │
│                                                                                                                │
│    The Partners GraphQL API responded unsuccessfully with the HTTP status 200 and errors:                      │
│                                                                                                                │
│    [                                                                                                           │
│    {                                                                                                           │
│      "message": "Upgrade your CLI version to run the deploy command.",                                         │
│      "locations": [                                                                                            │
│        {                                                                                                       │
│          "line": 3,                                                                                            │
│          "column": 5                                                                                           │
│        }                                                                                                       │
│      ],                                                                                                        │
│      "path": [                                                                                                 │
│        "deploymentGenerateSignedUploadUrl"                                                                     │
│      ],                                                                                                        │
│      "extensions": {                                                                                           │
│        "type": "unsupported_client_version"                                                                    │
│      }                                                                                                         │
│    }                                                                                                           │
│  ]                                                                                                             │
│                                                                                                                │
│                                                                                                                │
│  To investigate the issue, examine this stack trace:                                                           │
│    at makeRequest (graphql-request/src/index.ts:441)                                                           │
│      throw new ClientError(                                                                                    │
│    at processTicksAndRejections (node:internal/process/task_queues:95)                                         │
│    at async debugLogResponseInfo (@shopify/cli-kit/src/private/node/api.ts:26)                                 │
│      response = await request                                                                                  │
│    at async graphqlRequest (@shopify/cli-kit/src/public/node/api/graphql.ts:44)                                │
│      const response = await debugLogResponseInfo(                                                              │
│    at async getExtensionUploadURL (@shopify/app/src/cli/services/deploy/upload.ts:289)                         │
│      const result: GenerateSignedUploadUrlSchema = await partnersRequest(mutation, token, variables)           │
│    at async uploadExtensionsBundle (@shopify/app/src/cli/services/deploy/upload.ts:120)                        │
│      signedURL = await getExtensionUploadURL(options.apiKey, deploymentUUID)                                   │
│    at task (@shopify/app/src/cli/services/deploy.ts:124)                                                       │
│      ;({validationErrors, deploymentId} = await uploadExtensionsBundle({                                       │
│    at async runTask (@shopify/cli-kit/src/private/node/ui/components/Tasks.tsx:46)                             │
│      return await task.task(ctx, task)                                                                         │
│    at async runTasks (@shopify/cli-kit/src/private/node/ui/components/Tasks.tsx:80)                            │
│      const subTasks = await runTask(task, ctx.current)                                                         │
│                                                                                                                │
╰────────────────────────────────────────────────────────────────────────────────────────────────────────────────╯

2. When running: npm run shopify version, it prompted: Running this command will add the dependency to the workspace root rather than the workspace itself. See Figure 2.

When running: npm run shopify version, it prompted: Running this command will add the dependency to the workspace root rather than the workspace itself
Figure 2
Plaintext
wangqiang@DESKTOP-QLPK8QM:/mnt/e/wwwroot/shopify-app/learn-php-app-0605-prod$ npm run shopify version

> learn-php-app-ubuntu-2004-0605@1.0.0 shopify
> shopify version

Current Shopify CLI version: 3.46.2
💡 Version 3.52.0 available! Run npm run shopify upgrade
wangqiang@DESKTOP-QLPK8QM:/mnt/e/wwwroot/shopify-app/learn-php-app-0605-prod$ npm run shopify upgrade

> learn-php-app-ubuntu-2004-0605@1.0.0 shopify
> shopify upgrade

Upgrading CLI from 3.46.2 to 3.52.0...
yarn add v1.22.21
error Running this command will add the dependency to the workspace root rather than the workspace itself, which might not be what you want - if you really meant it, make it explicit by running this command again with the -W flag (or --ignore-workspace-root-check).
info Visit https://yarnpkg.com/en/docs/cli/add for documentation about this command.
── external error ────────────────────────────────────────────────────────────────────────────────────────────────

Error coming from `yarn add @shopify/cli@latest @shopify/app@latest --prod`

Command failed with exit code 1: yarn add @shopify/cli@latest @shopify/app@latest --prod
error Running this command will add the dependency to the workspace root rather than the workspace itself, which might not be what you want - if you really meant it, make
it explicit by running this command again with the -W flag (or --ignore-workspace-root-check).
yarn add v1.22.21
info Visit https://yarnpkg.com/en/docs/cli/add for documentation about this command.

──────────────────────────────────────────────────────────────────────────────────────────────────────────────────

3. I finally decided to directly edit: package.json.

Before editing:

JSON
"dependencies": {
"@shopify/app": "3.46.2",
"@shopify/cli": "3.46.2"
}

After editing:

JSON

"dependencies": {
"@shopify/app": "3.52.0",
"@shopify/cli": "3.52.0"
}

4. I ran the command: yarn install to reinstall the dependencies. Checking the version again showed that it was already the latest version. See Figure 3.

Ran the command: yarn install to reinstall the dependencies. Checking the version again showed that it was already the latest version
Figure 3
Plaintext

wangqiang@DESKTOP-QLPK8QM:/mnt/e/wwwroot/shopify-app/learn-php-app-0605-prod$ yarn shopify version
yarn run v1.22.15
$ shopify version
Current Shopify CLI version: 3.52.0
Done in 98.23s.

关于作者 · 持续学习与技术实践

我是一名拥有 15 年以上开发经验的技术从业者,自 2013 年起持续运营个人技术博客,记录工作与个人项目中遇到的真实问题,以及解决问题过程中的探索、实践和思考。

除了技术写作,我也在持续开发和维护自己的独立项目,探索新技术和新工具在实际场景中的应用。我始终相信,没有不值得去解决的问题,也没有不值得去学习的技术。

如果这篇文章对你有所帮助,欢迎浏览博客中的其他文章,也欢迎交流技术经验与想法。

关于我  ·  GitHub  ·  邮件联系