我对部署/托管 Node 应用程序和 Puppeteer 不太熟悉。
\n但是,当我尝试使用 Puppeteer 时,我在 Heroku 上的应用程序遇到了问题。
\n完整的错误是:
\n\nError: Could not find Chromium (rev. 1056772). This can occur if either\n\n2022-11-10T06:44:07.938983+00:00 app[web.1]: 1. you did not perform an installation before running the script (e.g. `npm install`) or\n\n2022-11-10T06:44:07.938983+00:00 app[web.1]: 2. your cache path is incorrectly configured (which is: /app/.cache/puppeteer).\n\n2022-11-10T06:44:07.938983+00:00 app[web.1]: For (2), check out our guide on configuring puppeteer at https://pptr.dev/guides/configuration.\n\n2022-11-10T06:44:07.938984+00:00 app[web.1]: at ChromeLauncher.resolveExecutablePath (/app/node_modules/puppeteer-core/lib/cjs/puppeteer/node/ProductLauncher.js:120:27)\n\n2022-11-10T06:44:07.938984+00:00 app[web.1]: at ChromeLauncher.executablePath (/app/node_modules/puppeteer-core/lib/cjs/puppeteer/node/ChromeLauncher.js:166:25)\n\n2022-11-10T06:44:07.938985+00:00 app[web.1]: at PuppeteerNode.executablePath (/app/node_modules/puppeteer-core/lib/cjs/puppeteer/node/PuppeteerNode.js:162:105)\n\n2022-11-10T06:44:07.938985+00:00 app[web.1]: at Object.<anonymous> …Run Code Online (Sandbox Code Playgroud)