英文:
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 -->
{
"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"
]
}
}
<!-- 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.
通过集体智慧和协作来改善编程学习和解决问题的方式。致力于成为全球开发者共同参与的知识库,让每个人都能够通过互相帮助和分享经验来进步。
评论