错误:(gcloud.app.deploy) 错误响应:[9] 云构建 XXX 状态:失败

huangapple go评论71阅读模式
英文:

ERROR: (gcloud.app.deploy) Error Response: [9] Cloud build XXX status: FAILURE

问题

我正尝试部署我的应用程序,但收到以下错误:

ERROR: (gcloud.app.deploy) Error Response: [9] Cloud build ce067810-d3ad-4ebe-b8ba-b9fa03e371a4 status: FAILURE
npm ERR! code EUSAGE
npm ERR!
npm ERR! `npm ci`只能在package.json和package-lock.json或npm-shrinkwrap.json同步时安装包。请在继续之前使用`npm install`更新您的锁定文件。
npm ERR!
npm ERR! 无效: 锁定文件的ajv@8.12.0不满足ajv@6.12.6
npm ERR! 缺少: 锁定文件的json-schema-traverse@0.4.1
npm ERR! 缺少: 锁定文件的ajv@8.12.0
npm ERR! 缺少: 锁定文件的typescript@4.9.5
npm ERR! 缺少: 锁定文件的@apideck/better-ajv-errors@0.3.6
npm ERR! 缺少: 锁定文件的ajv@8.12.0
npm ERR! 缺少: 锁定文件的ajv@8.12.0
npm ERR! 缺少: 锁定文件的ajv@8.12.0
npm ERR! 缺少: 锁定文件的ajv@8.12.0
npm ERR! 缺少: 锁定文件的ajv@8.12.0
npm ERR! 缺少: 锁定文件的ajv@8.12.0
npm ERR!
npm ERR! 清理项目的安装
npm ERR!
npm ERR! 用法:
npm ERR! npm ci
npm ERR!
npm ERR! 选项:
npm ERR! [-S|--save|--no-save|--save-prod|--save-dev|--save-optional|--save-peer|--save-bundle]
npm ERR! [-E|--save-exact] [-g|--global]
npm ERR! [--install-strategy <hoisted|nested|shallow|linked>] [--legacy-bundling]
npm ERR! [--global-style] [--omit <dev|optional|peer> [--omit <dev|optional|peer> ...]]
npm ERR! [--strict-peer-deps] [--no-package-lock] [--foreground-scripts]
npm ERR! [--ignore-scripts] [--no-audit] [--no-bin-links] [--no-fund] [--dry-run]
npm ERR! [-w|--workspace <workspace-name> [-w|--workspace <workspace-name> ...]]
npm ERR! [-ws|--workspaces] [--include-workspace-root] [--install-links]
npm ERR!
npm ERR! 别名: clean-install, ic, install-clean, isntall-clean
npm ERR!
npm ERR! 运行“npm help ci”获取更多信息

运行npm ci似乎没有改变,我正在使用Node版本16.13.0。

我不确定这个错误的含义,任何帮助将不胜感激。

app.yaml:

runtime: nodejs18
service: default
entrypoint: serve -s build

package.json:

{
  "name": "client",
  "version": "0.1.0",
  "private": true,
  "dependencies": {
    "@testing-library/jest-dom": "^5.16.5",
    "@testing-library/react": "^13.4.0",
    "@testing-library/user-event": "^13.5.0",
    "axios": "^1.3.3",
    "dotenv": "^16.0.3",
    "moment": "^2.29.4",
    "react": "^18.2.0",
    "react-dom": "^18.2.0",
    "react-router-dom": "^6.8.2",
    "react-scripts": "^5.0.1",
    "serve": "^14.2.0",
    "stripe": "^12.9.0",
    "web-vitals": "^2.1.4"
  },
  "scripts": {
    "start": "react-scripts start",
    "build": "react-scripts build",
    "test": "react-scripts test",
    "eject": "react-scripts eject"
  },
  "browserslist": {
    "production": [
      ">0.2%",
      "not dead",
      "not op_mini all"
    ],
    "development": [
      "last 1 chrome version",
      "last 1 firefox version",
      "last 1 safari version"
    ]
  }
}
英文:

I am trying to deploy my application howvever i recieve this error:

<!-- begin snippet: js hide: false console: true babel: false -->

<!-- language: lang-html -->

ERROR: (gcloud.app.deploy) Error Response: [9] Cloud build ce067810-d3ad-4ebe-b8ba-b9fa03e371a4 status: FAILURE
npm ERR! code EUSAGE
npm ERR! 
npm ERR! `npm ci` can only install packages when your package.json and package-lock.json or npm-shrinkwrap.json are in sync. Please update your lock file with `npm install` before continuing.
npm ERR! 

npm ERR! Invalid: lock file's ajv@8.12.0 does not satisfy ajv@6.12.6
npm ERR! Missing: json-schema-traverse@0.4.1 from lock file
npm ERR! Missing: ajv@8.12.0 from lock file
npm ERR! Missing: typescript@4.9.5 from lock file
npm ERR! Missing: @apideck/better-ajv-errors@0.3.6 from lock file
npm ERR! Missing: ajv@8.12.0 from lock file
npm ERR! Missing: ajv@8.12.0 from lock file
npm ERR! Missing: ajv@8.12.0 from lock file
npm ERR! Missing: ajv@8.12.0 from lock file
npm ERR! Missing: ajv@8.12.0 from lock file
npm ERR! Missing: ajv@8.12.0 from lock file
npm ERR!
npm ERR! Clean install a project
npm ERR!
npm ERR! Usage:
npm ERR! npm ci
npm ERR!
npm ERR! Options:
npm ERR! [-S|--save|--no-save|--save-prod|--save-dev|--save-optional|--save-peer|--save-bundle]
npm ERR! [-E|--save-exact] [-g|--global]
npm ERR! [--install-strategy <hoisted|nested|shallow|linked>] [--legacy-bundling]
npm ERR! [--global-style] [--omit <dev|optional|peer> [--omit <dev|optional|peer> ...]]
npm ERR! [--strict-peer-deps] [--no-package-lock] [--foreground-scripts]
npm ERR! [--ignore-scripts] [--no-audit] [--no-bin-links] [--no-fund] [--dry-run]
npm ERR! [-w|--workspace <workspace-name> [-w|--workspace <workspace-name> ...]]
npm ERR! [-ws|--workspaces] [--include-workspace-root] [--install-links]
npm ERR!
npm ERR! aliases: clean-install, ic, install-clean, isntall-clean
npm ERR!
npm ERR! Run "npm help ci" for more info

<!-- end snippet -->

running npm ci does not seem to change and i am running on node v 16.13.0

I am not sure what the error means, any help would be appreciated

app.yaml:

<!-- begin snippet: js hide: false console: true babel: false -->

<!-- language: lang-js -->

runtime: nodejs18
service: default
entrypoint: serve -s build

<!-- end snippet -->

package.json

<!-- begin snippet: js hide: false console: true babel: false -->

<!-- language: lang-js -->

{
  &quot;name&quot;: &quot;client&quot;,
  &quot;version&quot;: &quot;0.1.0&quot;,
  &quot;private&quot;: true,
  &quot;dependencies&quot;: {
    &quot;@testing-library/jest-dom&quot;: &quot;^5.16.5&quot;,
    &quot;@testing-library/react&quot;: &quot;^13.4.0&quot;,
    &quot;@testing-library/user-event&quot;: &quot;^13.5.0&quot;,
    &quot;axios&quot;: &quot;^1.3.3&quot;,
    &quot;dotenv&quot;: &quot;^16.0.3&quot;,
    &quot;moment&quot;: &quot;^2.29.4&quot;,
    &quot;react&quot;: &quot;^18.2.0&quot;,
    &quot;react-dom&quot;: &quot;^18.2.0&quot;,
    &quot;react-router-dom&quot;: &quot;^6.8.2&quot;,
    &quot;react-scripts&quot;: &quot;^5.0.1&quot;,
    &quot;serve&quot;: &quot;^14.2.0&quot;,
    &quot;stripe&quot;: &quot;^12.9.0&quot;,
    &quot;web-vitals&quot;: &quot;^2.1.4&quot;
  },
  &quot;scripts&quot;: {
    &quot;start&quot;: &quot;react-scripts start&quot;,
    &quot;build&quot;: &quot;react-scripts build&quot;,
    &quot;test&quot;: &quot;react-scripts test&quot;,
    &quot;eject&quot;: &quot;react-scripts eject&quot;
  },
  &quot;browserslist&quot;: {
    &quot;production&quot;: [
      &quot;&gt;0.2%&quot;,
      &quot;not dead&quot;,
      &quot;not op_mini all&quot;
    ],
    &quot;development&quot;: [
      &quot;last 1 chrome version&quot;,
      &quot;last 1 firefox version&quot;,
      &quot;last 1 safari version&quot;
    ]
  }
}

<!-- end snippet -->

答案1

得分: 1

锁定文件(package-lock.json)与您遇到的问题相关,但与package.json文件不同步。锁定文件用于保证依赖项的可靠和一致安装。

在部署应用程序之前,您必须执行npm install以更新锁定文件,以解决部署错误。

此命令将更新锁定文件以确保依赖项之间的兼容性,并安装在package.json文件中列出的依赖项。然后,您可以尝试再次部署您的应用程序。

英文:

The lock file (package-lock.json), which is relevant to the problem you're seeing, is not in sync with the package.json file. The lock file is used to guarantee reliable and consistent installation of dependencies.

Before deploying your application, you must execute npm install to update the lock file in order to fix the deployment error.

This command will update the lock file to ensure compatibility between dependencies and install the dependencies listed in your package.json file. You can then attempt to deploy your application once more.

huangapple
  • 本文由 发表于 2023年6月16日 01:19:06
  • 转载请务必保留本文链接:https://go.coder-hub.com/76484082.html
匿名

发表评论

匿名网友

:?: :razz: :sad: :evil: :!: :smile: :oops: :grin: :eek: :shock: :???: :cool: :lol: :mad: :twisted: :roll: :wink: :idea: :arrow: :neutral: :cry: :mrgreen:

确定