【发布时间】:2021-12-13 05:01:15
【问题描述】:
我试图在 heroku 上托管一个不和谐的机器人,但我遇到了这个错误。
Link to the photo of the error
我有最新版本的 discord.js 和 Node.js
我的procfile是这样的
worker: node ./src/index.js
【问题讨论】:
标签: node.js heroku discord discord.js
我试图在 heroku 上托管一个不和谐的机器人,但我遇到了这个错误。
Link to the photo of the error
我有最新版本的 discord.js 和 Node.js
我的procfile是这样的
worker: node ./src/index.js
【问题讨论】:
标签: node.js heroku discord discord.js
Heroku 使用的是旧版本的 node.js,这就是为什么你会看到这个错误!遗憾的是,您无法更新此版本,因此没有真正适合您的解决方案
【讨论】:
要修复该错误,您应该先使用 npx,然后再使用 node
worker: npx node ./src/index.js
或
worker: npx node .
它应该可以工作。
【讨论】: