【问题标题】:ERROR: build step 0 "gcr.io/cloud-builders/docker" failed: exit status 1错误:构建步骤 0“gcr.io/cloud-builders/docker”失败:退出状态 1
【发布时间】:2019-09-11 21:24:49
【问题描述】:

我正在尝试使用 bitbucket 管道将我的第一个应用程序部署在谷歌云存储桶中,但在谷歌云控制台中出现以下错误。

ERROR: build step 0 "gcr.io/cloud-builders/docker" failed: exit status 1
ERROR
The command '/bin/sh -c yarn install --production || ((if [ -f yarn-error.log ]; then cat yarn-error.log; fi) && false)' returned a non-zero code: 1
info Visit https://yarnpkg.com/en/docs/cli/install for documentation about this command.
error Found incompatible module
error acp-web@1.0.0: The engine "node" is incompatible with this module. Expected version "9.11.1". Got "9.11.2"
[1/5] Validating package.json...
warning package-lock.json found. Your project contains lock files generated by tools other than Yarn. It is advised not to mix package managers in order to avoid resolution inconsistencies caused by unsynchronized lock files. To clear this warning, remove package-lock.json.
yarn install v1.15.2
---> Running in c25c801a41d0
Step 5/6 : RUN yarn install --production || ((if [ -f yarn-error.log ]; then cat yarn-error.log; fi) && false)
---> 9a31a847bb75
[...]

基本上,我在 React Js 中有一个需要部署在谷歌云中的应用程序,我已经成功解决了所有错误,但目前我没有得到什么问题

bitbucket-pipeline.yml

image: node:10.15.1

pipelines:
  default:
    - step:
        name: Build and Test
        script:
          - npm install
          - npm test
    - step:
        name: Deploy
        script:
          - pipe: atlassian/google-app-engine-deploy:0.2.1
            variables:
              KEY_FILE: $KEY_FILE
              PROJECT: '[project-name] is here'

app.yaml

env: flex
runtime: custom
api_version: 1
threadsafe: true
handlers:
- url: /(.*\.(html|css|js|png|jpg|woff|json))
  static_files: dist/\1
  upload: dist/(.*\.(html|css|js|png|jpg|woff|json))
- url: /.*
  static_files: dist/index.html
  upload: dist/index.html
- url: /
  static_dir: build
skip_files:
- node_modules/
- ^\.git/.*
- ^(.*/)?#.*#$
- ^(.*/)?.*~$
- ^(.*/)?.*\.py[co]$
- ^(.*/)?.*/RCS/.*$
- ^(.*/)?\..*$
- ^(.*/)?.*\.bak$

我只想将此应用部署到谷歌云应用引擎中

【问题讨论】:

    标签: google-cloud-platform bitbucket google-cloud-storage gcloud bitbucket-api


    【解决方案1】:

    根据这一行,它似乎使用了不正确的 node.js 版本:

    error acp-web@1.0.0: The engine "node" is incompatible with this module. Expected version "9.11.1". Got "9.11.2"
    

    不过,您在管道中指定了 10.15.1。您能否确保为您的项目应用了正确的版本?

    【讨论】:

      【解决方案2】:

      在我的例子中,有人在同一个项目中使用了 yarn 和 npm。一旦我进入 repo 并运行 npm install 它更新了一些包,之后 docker 工作流程就很好了。

      【讨论】:

        【解决方案3】:

        app.yaml文件中,需要提及:

        runtime: nodejs
        

        【讨论】:

          猜你喜欢
          • 1970-01-01
          • 1970-01-01
          • 1970-01-01
          • 1970-01-01
          • 2020-03-14
          • 2020-05-03
          • 1970-01-01
          • 1970-01-01
          • 1970-01-01
          相关资源
          最近更新 更多