easychen / book-by-ai

Generate high-quality books with AI
MIT License
228 stars 36 forks source link

wsl2,title\index\sections都成功,write直接报错找不到浏览器 #6

Open GPTlei opened 1 year ago

GPTlei commented 1 year ago

win11,wsl2,ubuntu已经安装chrome,win11也安装了。 具体报错如下:

book_cn@write [] 请稍候,正在发起搜索请求… file:///home/pico/BBA/node_modules/@puppeteer/browsers/lib/esm/launch.js:268 reject(new Error([ ^

Error: Failed to launch the browser process! spawn /Applications/Google Chrome.app/Contents/MacOS/Google Chrome ENOENT

TROUBLESHOOTING: https://pptr.dev/troubleshooting

at ChildProcess.onClose (file:///home/pico/BBA/node_modules/@puppeteer/browsers/lib/esm/launch.js:268:24)
at ChildProcess.emit (node:events:514:28)
at ChildProcess._handle.onexit (node:internal/child_process:289:12)
at onErrorNT (node:internal/child_process:476:16)
at process.processTicksAndRejections (node:internal/process/task_queues:82:21)

Node.js v18.17.1

easychen commented 1 year ago

需要在这里指定 wsl2 下可以访问的浏览器路径

https://github.com/easychen/book-by-ai/blob/d57731500d6fe56568bfe7ac40fc5326e5c45b67/.env.cn.example#L24