我有一个node12应用程序,它在gcloud应用程序引擎上运行了几周。现在突然间,它在试图发射木偶师时坠毁了:
/workspace/node_modules/puppeteer/.local-chromium/linux-737027/chrome-linux/chrome: error while loading shared libraries: libgbm.so.1: cannot open shared object file: No such file or directory
2020-05-13 14:42:35 default[20200513t163546]
2020-05-13 14:42:35 default[20200513t163546]
2020-05-13 14:42:35 default[20200513t163546] TROUBLESHOOTING:
https://github.com/puppeteer/puppeteer/blob/master/docs/troubleshooting.md
2020-05-13 14:42:35 default[20200513t163546]
2020-05-13 14:42:35 default[20200513t163546] at onClose
(/workspace/node_modules/puppeteer/lib/Launcher.js:547:20)
2020-05-13 14:42:35 default[20200513t163546] at Interface.<anonymous>
(/workspace/node_modules/puppeteer/lib/Launcher.js:537:65)
2020-05-13 14:42:35 default[20200513t163546] at Interface.emit (events.js:322:22)
2020-05-13 14:42:35 default[20200513t163546] at Interface.close (readline.js:409:8)
2020-05-13 14:42:35 default[20200513t163546] at Socket.onend (readline.js:187:10)
2020-05-13 14:42:35 default[20200513t163546] at Socket.emit (events.js:322:22)
2020-05-13 14:42:35 default[20200513t163546] at endReadableNT (_stream_readable.js:1187:12)
2020-05-13 14:42:35 default[20200513t163546] at processTicksAndRejections
(internal/process/task_queues.js:84:21)这是我的源代码:
const browser = await puppeteer.launch({
timeout: 10000,
headless: true,
args: ['--no-sandbox', '--disable-setuid-sandbox']
});我的app.yaml:
runtime: nodejs12
instance_class: F4_1G我的package.json
{
...
{
"dependencies": {
"@google-cloud/firestore": "^3.7.5",
"@google-cloud/storage": "^4.7.0",
"body-parser": "^1.19.0",
"cors": "^2.8.5",
"express": "^4.17.1",
"fs": "0.0.1-security",
"path": "^0.12.7",
"puppeteer": "^3.0.4",
"resemblejs": "^3.2.4",
"stream": "0.0.2"
},
"engines": {
"node": "12.x.x"
}
}在其他环境中,如Firebase (node10)、Heroku (node12)和一些本地托管伙伴,我也遇到了同样的问题。主要的问题似乎是,一些模块是缺少的,这是木偶师的要求,以推出Chrome。然而,作为唯一的环境,它已经在Google上运行了几个星期了--现在,它不再起作用了。
发布于 2020-05-25 23:55:55
我也有同样的问题,我用以下方法解决了这个问题:
-NodeJS 10和PuppetorVersion2.1.1。具有以下参数的浏览器-Initialize:
const浏览器=等待puppeteer.launch ({ args:‘-no-sandbox’});
这个库似乎还没有添加到运行时中。
https://stackoverflow.com/questions/61777810
复制相似问题