我試圖從GCP部署'hello-World'節點示例到Google App Engine。將節點應用程序部署到GAE:找不到模塊'v8-compile-cache'
而且我遵循快速入門頁面上的所有步驟。 (克隆git倉庫並在hello-world目錄中運行npm install) 而且在我的本地機器上,一切正常。
但每次我嘗試執行gcloud應用程序部署我得到以下錯誤:
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/[email protected]:926dc1a14e6f7eb5b3462b5c1d491aa6c73090291167ac2bf181c026b05f19da" failed: exit status 1
ERROR: (gcloud.app.deploy) Error Response: [2] Build failed; check build logs for details
但我敢肯定,V8編譯緩存安裝(如果我跑NPM LS我可以看到正確的模塊)
有誰知道如何解決這個問題?
這似乎是App Engine Flexible環境使用的最近更新的Base Nodejs映像的問題。 [一個公開的問題已被提交追蹤此](https://issuetracker.google.com/issues/37978206)。我建議您主演此問題以獲取更新。 – Nicholas