AutumnWhj / ChatGPT-wechat-bot

ChatGPT for wechat https://github.com/AutumnWhj/ChatGPT-wechat-bot
MIT License
4.67k stars 983 forks source link

请问一下这是什么错误21:16:58 ERR PuppetWeChatBridge start() exception: Error: An `executablePath` ... #49

Open JIAMing12 opened 1 year ago

JIAMing12 commented 1 year ago

./src/index.ts → lib/bundle.esm.js... created lib/bundle.esm.js in 1.9s 21:16:58 ERR PuppetWeChatBridge start() exception: Error: An executablePath or channel must be specified for puppeteer-core 21:16:58 ERR PuppetWeChat initBridge() exception: An executablePath or channel must be specified for puppeteer-core 21:16:58 ERR PuppetWeChat initBridge() this.bridge.stop() rejection: Error: no page GError: An executablePath or channel must be specified for puppeteer-core at assert (D:\22370\Code\Web\ChatGPT-wechat-bot\node_modules\puppeteer-core\lib\cjs\puppeteer\util\assert.js:28:15) at ChromeLauncher.launch (D:\22370\Code\Web\ChatGPT-wechat-bot\node_modules\puppeteer-core\lib\cjs\puppeteer\node\ChromeLauncher.js:69:36) at PuppeteerNode.launch (D:\22370\Code\Web\ChatGPT-wechat-bot\node_modules\puppeteer-core\lib\cjs\puppeteer\node\PuppeteerNode.js:154:105) at PuppeteerExtra.launch (D:\22370\Code\Web\ChatGPT-wechat-bot\node_modules\puppeteer-extra\dist\index.cjs.js:128:41) at async Bridge.initBrowser (file:///D:/22370/Code/Web/ChatGPT-wechat-bot/node_modules/wechaty-puppet-wechat/dist/esm/src/bridge.js:109:23) at async Bridge.start (file:///D:/22370/Code/Web/ChatGPT-wechat-bot/node_modules/wechaty-puppet-wechat/dist/esm/src/bridge.js:48:28) at async PuppetWeChat.initBridge (file:///D:/22370/Code/Web/ChatGPT-wechat-bot/node_modules/wechaty-puppet-wechat/dist/esm/src/puppet-wechat. js:176:13) at async PuppetWeChat.onStart (file:///D:/22370/Code/Web/ChatGPT-wechat-bot/node_modules/wechaty-puppet-wechat/dist/esm/src/puppet-wechat.js: 69:23) at async PuppetWeChat.start (file:///D:/22370/Code/Web/ChatGPT-wechat-bot/node_modules/state-switch/dist/esm/src/service-ctl/service-ctl.js:6 2:17) at async PuppetWeChat.start (file:///D:/22370/Code/Web/ChatGPT-wechat-bot/node_modules/wechaty-puppet/dist/esm/src/mixins/service-mixin.js:18 :13) { code: 2, details: 'Error: An executablePath or channel must be specified for puppeteer-core\n' + ' at assert (D:\22370\Code\Web\ChatGPT-wechat-bot\node_modules\puppeteer-core\lib\cjs\puppeteer\util\assert.js:28:15)\n' + ' at ChromeLauncher.launch (D:\22370\Code\Web\ChatGPT-wechat-bot\node_modules\puppeteer-core\lib\cjs\puppeteer\node\ChromeLaunc her.js:69:36)\n' + ' at PuppeteerNode.launch (D:\22370\Code\Web\ChatGPT-wechat-bot\node_modules\puppeteer-core\lib\cjs\puppeteer\node\PuppeteerNod e.js:154:105)\n' + ' at PuppeteerExtra.launch (D:\22370\Code\Web\ChatGPT-wechat-bot\node_modules\puppeteer-extra\dist\index.cjs.js:128:41)\n' + ' at async Bridge.initBrowser (file:///D:/22370/Code/Web/ChatGPT-wechat-bot/node_modules/wechaty-puppet-wechat/dist/esm/src/bridge.js:109: 23)\n' + ' at async Bridge.start (file:///D:/22370/Code/Web/ChatGPT-wechat-bot/node_modules/wechaty-puppet-wechat/dist/esm/src/bridge.js:48:28)\n' + ' at async PuppetWeChat.initBridge (file:///D:/22370/Code/Web/ChatGPT-wechat-bot/node_modules/wechaty-puppet-wechat/dist/esm/src/puppet-we chat.js:176:13)\n' + ' at async PuppetWeChat.onStart (file:///D:/22370/Code/Web/ChatGPT-wechat-bot/node_modules/wechaty-puppet-wechat/dist/esm/src/puppet-wecha t.js:69:23)\n' + ' at async PuppetWeChat.start (file:///D:/22370/Code/Web/ChatGPT-wechat-bot/node_modules/state-switch/dist/esm/src/service-ctl/service-ctl .js:62:17)\n' + ' at async PuppetWeChat.start (file:///D:/22370/Code/Web/ChatGPT-wechat-bot/node_modules/wechaty-puppet/dist/esm/src/mixins/service-mixin. js:18:13)' }

JIAMing12 commented 1 year ago

编译运行的时候报的

AutumnWhj commented 1 year ago

请问你的node版本是? 重新npm run dev还会出现吗

JIAMing12 commented 1 year ago

node版本是v16.16.0.,运行重复出现,以管理员身份运行也会

JIAMing12 commented 1 year ago

node版本v16.16.0. 重新运行打开还是这样,并且以管理员身份运行一样的

AutumnWhj commented 1 year ago

@JIAMing12 试出来了 你执行下面的命令试试

sudo apt-get install  ca-certificates fonts-liberation libasound2 libatk-bridge2.0-0 libatk1.0-0 libc6 libcairo2 libcups2 libdbus-1-3 libexpat1 libfontconfig1 libgbm1 libgcc1 libglib2.0-0 libgtk-3-0 libnspr4 libnss3 libpango-1.0-0 libpangocairo-1.0-0 libstdc++6 libx11-6 libx11-xcb1 libxcb1 libxcomposite1 libxcursor1 libxdamage1 libxext6 libxfixes3 libxi6 libxrandr2 libxrender1 libxss1 libxtst6 lsb-release wget xdg-utils

如果不能运行,再安装 apt-get install chromium-browser

JIAMing12 commented 1 year ago

这个我node环境是怎么安装?

JIAMing12 commented 1 year ago

执行npm install chromium-browser 报PS D:\22370\Code\Web\ChatGPT-wechat-bot> npm install chromium-browser npm ERR! code E404 npm ERR! 404 Not Found - GET https://registry.npmmirror.com/chromium-browser - [NOT_FOUND] chromium-browser not found npm ERR! 404 npm ERR! 404 'chromium-browser@*' is not in this registry. npm ERR! 404 npm ERR! 404 Note that you can also install from a npm ERR! 404 tarball, folder, http url, or git url.

npm ERR! A complete log of this run can be found in:

JIAMing12 commented 1 year ago

我是Windows系统,你那个命令是其它操作系统的吧?

JIAMing12 commented 1 year ago

@AutumnWhj 在吗

JIAMing12 commented 1 year ago

@AutumnWhj 安装的这些包名 node环境下没法安装,我执行的是npm install ca-certificates.....

JIAMing12 commented 1 year ago

我把NODE 环境升级到最新还是同样问提,,,唉

tigershan1130 commented 1 year ago

same here.. windows...

zwglory commented 1 year ago

我是Windows系统,你那个命令是其它操作系统的吧?

您好,我在windows10上部署这个项目时,也遇到了同样的问题,请问后续这个问题又被解决么,感谢!

zwglory commented 1 year ago

我是Windows系统,你那个命令是其它操作系统的吧?

您好,我在windows10上部署这个项目时,也遇到了同样的问题,请问后续这个问题又被解决么,感谢!

已解决,在 package.json 中将puppeteer的版本改为13.7.0,如下:

  "dependencies": {
    "chatgpt": "^3.4.1",
    "chatgpt-api": "^0.0.6",
    "p-timeout": "^6.0.0",
    "qrcode-terminal": "^0.12.0",
    "wechaty": "^1.20.2",
    "wechaty-puppet-wechat": "^1.18.4",
    "puppeteer": "^13.7.0"
  },

然后运行下面步骤:

rm node_modules
rm package-lock.json
npm cache clear --force
npm i

重新编译运行:

npm run build
node .\lib\bundle.esm.js