【问题标题】:Deploy Node App to GAE: Cannot find module 'v8-compile-cache'将节点应用程序部署到 GAE:找不到模块“v8-compile-cache”
【发布时间】: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 我可以看到正确的模块)

有人知道如何解决这个问题吗?

【问题讨论】:

标签: node.js google-app-engine google-cloud-platform


【解决方案1】:

这可以帮助你

npm i v8-compile-cache

【讨论】:

  • 您的答案可以通过额外的支持信息得到改进。请edit 添加更多详细信息,例如引用或文档,以便其他人可以确认您的答案是正确的。你可以找到更多关于如何写好答案的信息in the help center
猜你喜欢
  • 1970-01-01
  • 2014-10-21
  • 2018-03-31
  • 2021-01-06
  • 2012-01-24
  • 1970-01-01
  • 2014-04-20
  • 1970-01-01
  • 2018-03-01
相关资源
最近更新 更多