我想在Raspberry pi 0 w上运行一个带有傀儡的节点js脚本,但是我得到了这个错误:
(node:5699) UnhandledPromiseRejectionWarning: Error: Failed to launch the browser process!
/SteamCheaper/node_modules/puppeteer/.local-chromium/linux-722234/chrome-linux/chrome: 1: /SteamCheaper/node_modules/puppeteer/.local-chromium/linux-722234/chrome-linux/chrome: �: not found
/SteamCheaper/node_modules/puppeteer/.local-chromium/linux-722234/chrome-linux/chrome: 1: /SteamCheaper/node_modules/puppeteer/.local-chromium/linux-722234/chrome-linux/chrome: ELF: not found
/SteamCheaper/node_modules/puppeteer/.local-chromium/linux-722234/chrome-linux/chrome: 2: /SteamCheaper/node_modules/puppeteer/.local-chromium/linux-722234/chrome-linux/chrome: p#: not found
/SteamCheaper/node_modules/puppeteer/.local-chromium/linux-722234/chrome-linux/chrome: 3: /SteamCheaper/node_modules/puppeteer/.local-chromium/linux-722234/chrome-linux/chrome: p#: not found
/SteamCheaper/node_modules/puppeteer/.local-chromium/linux-722234/chrome-linux/chrome: 4: /SteamCheaper/node_modules/puppeteer/.local-chromium/linux-722234/chrome-linux/chrome: @l�: not found
/SteamCheaper/node_modules/puppeteer/.local-chromium/linux-722234/chrome-linux/chrome: 5: /SteamCheaper/node_modules/puppeteer/.local-chromium/linux-722234/chrome-linux/chrome: pX: not found
/SteamCheaper/node_modules/puppeteer/.local-chromium/linux-722234/chrome-linux/chrome: 6: /SteamCheaper/node_modules/puppeteer/.local-chromium/linux-722234/chrome-linux/chrome: pX: not found
/SteamCheaper/node_modules/puppeteer/.local-chromium/linux-722234/chrome-linux/chrome: 7: /SteamCheaper/node_modules/puppeteer/.local-chromium/linux-722234/chrome-linux/chrome: Syntax error: "(" unexpected
/SteamCheaper/node_modules/puppeteer/.local-chromium/linux-722234/chrome-linux/chrome: 4: /SteamCheaper/node_modules/puppeteer/.local-chromium/linux-722234/chrome-linux/chrome: ��q: not found你能告诉我,我能用它做什么吗?
发布于 2020-03-24 18:44:12
木偶师默认使用捆绑铬。错误说它无法启动它。
你应该手动安装Chromium并让Puppeteer使用该版本。假设您已经在/usr/bin/chromium中安装了它,这样的操作将完成以下工作:
const browser = await puppeteer.launch({
product: "chrome", executablePath: "/usr/bin/chromium",
})发布于 2020-06-17 19:51:14
这是基本的代码,使Chrome无头和Puppeteer工作的Raspberry Pi,与一个新安装的Raspbian拉伸Lite。
sudo apt install chromium-browser chromium-codecs-ffmpeg
sudo apt install npm
npm install puppeteer-core@v1.11.0在node.js中
const puppeteer = require('puppeteer-core');
const browser = await puppeteer.launch({executablePath: '/usr/bin/chromium-browser'});https://stackoverflow.com/questions/60129309
复制相似问题