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

在 运行:npm run shopify version 时,提示:Running this command will add the dependency to the workspace root rather than the workspace itself

执行命令:npm run deploy 时,报错:Upgrade your CLI version to run the deploy command.。提示需要升级 CLI 的版本

1、执行命令:npm run deploy 时,报错:Upgrade your CLI version to run the deploy command.。提示需要升级 CLI 的版本。如图1

执行命令:npm run deploy 时,报错:Upgrade your CLI version to run the deploy command.。提示需要升级 CLI 的版本
图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、在 运行:npm run shopify version 时,提示:Running this command will add the dependency to the workspace root rather than the workspace itself。如图2

在 运行:npm run shopify version 时,提示:Running this command will add the dependency to the workspace root rather than the workspace itself
图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、最终决定直接编辑:package.json。

编辑前:

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

编辑后:

JSON

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

4、执行命令:yarn install,重新安装依赖项。再次查看版本,已经是最新版本。如图3

执行命令:yarn install,重新安装依赖项。再次查看版本,已经是最新版本
图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  ·  邮件联系