【问题标题】:gcloud app deploy build fails with error module not found 'link-module-alias'gcloud app deploy build 失败,错误模块未找到'link-module-alias'
【发布时间】:2019-12-07 08:43:50
【问题描述】:

我正在尝试将 Node.js 应用程序部署到 GCP 应用程序引擎,但由于模块而导致构建失败。有问题的模块是“链接模块别名”。我尝试删除 yarn.lock 以重新安装模块。

谁能指出我做错了什么?

Step #1: INFO[0028] Taking snapshot of full filesystem...
Step #1: INFO[0038] RUN yarn install --production ||   ((if [ -f yarn-error.log ]; then       cat yarn-error.log;     fi) && false)
Step #1: INFO[0038] cmd: /bin/sh
Step #1: INFO[0038] args: [-c yarn install --production ||   ((if [ -f yarn-error.log ]; then       cat yarn-error.log;     fi) && false)]
Step #1: yarn install v1.21.0
Step #1: $ command -v link-module-alias && link-module-alias clean || true
Step #1: [1/5] Validating package.json...
Step #1: [2/5] Resolving packages...
Step #1: [3/5] Fetching packages...
Step #1: info fsevents@1.2.9: The platform "linux" is incompatible with this module.
Step #1: info "fsevents@1.2.9" is an optional dependency and failed compatibility check. Excluding it from installation.
Step #1: [4/5] Linking dependencies...
Step #1: [5/5] Building fresh packages...
Step #1: $ link-module-alias
Step #1: /bin/sh: 1: link-module-alias: not found
Step #1: error Command failed with exit code 127.
Step #1: info Visit https://yarnpkg.com/en/docs/cli/install for documentation about this command.
Step #1: error building image: error building stage: waiting for process to exit: exit status 1
Finished Step #1
ERROR
ERROR: build step 1 "gcr.io/kaniko-project/executor@sha256:f87c11770a4d3ed33436508d206c584812cd656e6ed08eda1cff5c1ee44f5870" failed: exit status 1
------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------

ERROR:  Cloud build failed. Check logs at https://console.cloud.google.com/gcr/builds/dd154faf-df52-4c34-9008-b3b963c15756?project=491794690190 Failure status: UNKNOWN: Error Response: [2] Build failed; check build logs for details

【问题讨论】:

  • 您是否尝试按照@ParthMehta 在步骤 3 中的建议使用 --verbosity=debug 标志以获得更完整的错误消息。还有 Cloud Build 日志说什么?
  • 投票this proposal 以缓解 [yarn] 和 [yarnpkg] 周围的标签混淆。

标签: node.js google-cloud-platform yarnpkg


【解决方案1】:

您是否尝试过运行构建

  1. docker --cleanup 清理文件系统的标志
  2. 如果上述方法不起作用,请尝试 docker --no-cache 这将强制 docker 映像重建其所有层
  3. 如果 1 和 2 不起作用,请尝试 --verbosity=debug

看看你会得到什么。 kaniko github 页面上的一些其他标志可能会有所帮助。见:https://github.com/GoogleContainerTools/kaniko

【讨论】:

  • 感谢帮助。抱歉延迟播放。
猜你喜欢
  • 2020-12-29
  • 2019-03-22
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 2020-07-03
  • 2017-01-31
  • 2019-12-27
相关资源
最近更新 更多