【问题标题】:How to solve GAE deployment error - Error Response [9]如何解决 GAE 部署错误 - 错误响应 [9]
【发布时间】:2021-11-30 08:33:26
【问题描述】:

我正在尝试将我的 React 应用部署到 GAE, 我使用云构建 最后我收到此错误:

ERROR: (gcloud.app.deploy) Error Response: [9] Cloud build 8a36fcd1-285e-49bc-a13f-b6aef9ae5c8f status: FAILURE
npm ERR! bindings not accessible from watchpack-chokidar2:fsevents

这是我的 app.yaml:

runtime: nodejs14
service: ***********
basic_scaling:
  max_instances: 10 
  idle_timeout: 5m
resources:
  cpu: 1
  memory_gb: 0.5
  disk_size_gb: 10
handlers: 
- url: /.*
  script: auto
  secure: always
  redirect_http_response_code: 301

这是 cloudBuild.yaml

    steps:
- name: node
  entrypoint: npm
  args: ['install']
- name: node
  entrypoint: npm
  args: ['run','build']
- name: 'gcr.io/cloud-builders/gcloud'
  args: ['app', 'deploy']
  timeout: 1200s
timeout: 1200s

【问题讨论】:

  • 嗨,你可以看到这是一个 npm 错误,你可以在stackoverflow 上解决这个问题,这与你的类似,我认为评论告诉你“npm 7 package-lock .js 无法被 npm6 CI 读取”可能会对您有所帮助。你的应用在本地也能正常运行吗?

标签: google-app-engine deployment


【解决方案1】:

请通过脚本部分查看您的 Jason 文件:

"scripts": { "start": "node server",*****Here should be also include the entry point, where this server is pointing.

我建议使用以下内容更新此值:

"scripts": { "start": "react-scripts start",*** adding this value , we were able to replicate your case without any issue.

我还建议您查看此文档以获取更多详细信息,并能够将您的设置与此文档中的设置进行比较:

app-engine-react-demo[1]

package.json[2]

你可以看看这个例子:

将 React 应用部署到 Google 的 App Engine[3]

查看下一篇同样提到类似案例的 stackoverflow 帖子:

应用引擎[4]

最后查看此文档,您首先需要运行 npm build 命令以上传文件,然后运行部署。

setup.sh[5]

[1]https://github.com/mikesparr/app-engine-react-demo

[2]https://github.com/mikesparr/app-engine-react-demo/blob/master/package.json

[3]https://blog.doit-intl.com/deploying-a-react-app-to-googles-app-engine-6efa8f4732c7

[4]Deploy create-react-app on Google App Engine

[5]https://github.com/mikesparr/app-engine-react-demo/blob/master/setup.sh

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 2021-06-10
    • 1970-01-01
    • 2019-04-22
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2019-04-17
    相关资源
    最近更新 更多