Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

启动puppeteer失败 #31

Open
daqyt opened this issue Jan 14, 2025 · 3 comments
Open

启动puppeteer失败 #31

daqyt opened this issue Jan 14, 2025 · 3 comments

Comments

@daqyt
Copy link

daqyt commented Jan 14, 2025

执行命令
pnpm init
pnpm install @karinjs/puppeteer
node .
日志
[Karin-puppeteer][10:57:31.577][MARK] @karinjs/puppeteer 正在启动中...
[Karin-puppeteer][10:57:31.580][INFO] 当前版本:1.6.0
[Karin-puppeteer][10:57:31.581][INFO] https://github.com/KarinJS/puppeteer
[chrome] /root/.cache/puppeteer/chrome/linux64-131.0.6778.87/chrome-linux64/chrome
[Karin-puppeteer][10:57:37.124][ERRO] unhandledRejection Error: Failed to launch the browser process!
[333540:333540:0114/105736.890449:ERROR:ozone_platform_x11.cc(244)] Missing X server or $DISPLAY
[333540:333540:0114/105736.914806:ERROR:env.cc(257)] The platform failed to initialize. Exiting.

TROUBLESHOOTING: https://github.com/puppeteer/puppeteer/blob/main/docs/troubleshooting.md

at onClose (/root/kg/node_modules/.pnpm/[email protected]/node_modules/puppeteer-core/lib/cjs/puppeteer/node/BrowserRunner.js:241:20)
at ChildProcess.<anonymous> (/root/kg/node_modules/.pnpm/[email protected]/node_modules/puppeteer-core/lib/cjs/puppeteer/node/BrowserRunner.js:232:79)
at ChildProcess.emit (node:events:536:35)
at ChildProcess._handle.onexit (node:internal/child_process:293:12)
@sj817
Copy link
Contributor

sj817 commented Jan 14, 2025

文档写了要初始化的。
npx init

@daqyt
Copy link
Author

daqyt commented Jan 15, 2025

文档写了要初始化的。
npx init
还是一样
Screenshot_2025_0115_062830.png

@sj817
Copy link
Contributor

sj817 commented Jan 15, 2025

config.jsonheadless 改为 true

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants