【发布时间】:2022-04-16 05:11:08
【问题描述】:
我尝试将“hello-World”节点示例从 GCP 部署到 Google App Engine。
我遵循了快速入门页面上的所有步骤。 (克隆 git 存储库并在 hello-world 目录中运行 npm install) 在我的本地机器上一切正常。
但每次我尝试运行 gcloud app deploy 我都会收到以下错误:
module.js:471
throw err;
^
Error: Cannot find module 'v8-compile-cache'
at Function.Module._resolveFilename (module.js:469:15)
at Function.Module._load (module.js:417:25)
at Module.require (module.js:497:17)
at require (internal/module.js:20:19)
at Object.<anonymous> (/nodejs/lib/node_modules/yarn/bin/yarn.js:25:3)
at Module._compile (module.js:570:32)
at Object.Module._extensions..js (module.js:579:10)
at Module.load (module.js:487:32)
at tryModuleLoad (module.js:446:12)
at Function.Module._load (module.js:438:3)
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
ERROR
ERROR: build step "gcr.io/cloud-builders/docker@sha256:926dc1a14e6f7eb5b3462b5c1d491aa6c73090291167ac2bf181c026b05f19da" failed: exit status 1
ERROR: (gcloud.app.deploy) Error Response: [2] Build failed; check build logs for details
但我很确定 v8-compile-cache 已安装(如果我运行 npm ls 我可以看到正确的模块)
有人知道如何解决这个问题吗?
【问题讨论】:
-
这似乎是 App Engine 柔性环境使用的最近更新的基本 Nodejs 映像存在问题。 A public issue has been filed to track this。我建议在此问题上加注星标以接收更新。
标签: node.js google-app-engine google-cloud-platform