首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >树莓皮零w上的木偶

树莓皮零w上的木偶
EN

Stack Overflow用户
提问于 2020-02-08 17:30:38
回答 2查看 4.7K关注 0票数 3

我想在Raspberry pi 0 w上运行一个带有傀儡的节点js脚本,但是我得到了这个错误:

代码语言:javascript
复制
(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

你能告诉我,我能用它做什么吗?

EN

回答 2

Stack Overflow用户

回答已采纳

发布于 2020-03-24 18:44:12

木偶师默认使用捆绑铬。错误说它无法启动它。

你应该手动安装Chromium并让Puppeteer使用该版本。假设您已经在/usr/bin/chromium中安装了它,这样的操作将完成以下工作:

代码语言:javascript
复制
const browser = await puppeteer.launch({
    product: "chrome", executablePath: "/usr/bin/chromium",
})
票数 6
EN

Stack Overflow用户

发布于 2020-06-17 19:51:14

这是基本的代码,使Chrome无头和Puppeteer工作的Raspberry Pi,与一个新安装的Raspbian拉伸Lite。

代码语言:javascript
复制
sudo apt install chromium-browser chromium-codecs-ffmpeg
sudo apt install npm
npm install puppeteer-core@v1.11.0

在node.js中

代码语言:javascript
复制
const puppeteer = require('puppeteer-core');

const browser = await puppeteer.launch({executablePath: '/usr/bin/chromium-browser'});
票数 2
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/60129309

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档