wangrongding / wechat-bot

🤖一个基于 WeChaty 结合 OpenAi ChatGPT / Kimi / 讯飞等Ai服务实现的微信机器人 ,可以用来帮助你自动回复微信消息,或者管理微信群/好友,检测僵尸粉等...
MIT License
4.39k stars 658 forks source link

启动服务报错:SyntaxError: Unexpected token '.' #112

Open ming2d941 opened 1 year ago

ming2d941 commented 1 year ago

操作系统:Centos 7 node版本:v12.19.1 npm版本:v6.14.8

问题描述: npm run dev启动服务失败,报错信息如下:

[root@fancy-box-2 wechat-bot]# npm run dev

wechat-bot@1.0.0 dev /root/self/wechat-bot node ./index.js

(node:1166) ExperimentalWarning: The ESM module loader is experimental. file:///root/self/wechat-bot/src/wechaty/sendMessage.js:16 const roomName = (await room?.topic()) || null // 群名称                                                        ^

SyntaxError: Unexpected token '.' at Loader.moduleStrategy (internal/modules/esm/translators.js:117:18) npm ERR! code ELIFECYCLE npm ERR! errno 1 npm ERR! wechat-bot@1.0.0 dev: node ./index.js npm ERR! Exit status 1 npm ERR! npm ERR! Failed at the wechat-bot@1.0.0 dev script. npm ERR! This is probably not a problem with npm. There is likely additional logging output above.

npm ERR! A complete log of this run can be found in: npm ERR! /root/.npm/_logs/2023-02-11T18_22_03_997Z-debug.log

finnfu commented 1 year ago

切换node版本到16.9.1