【问题标题】:Deploying a Discord.js bot written in Typescript to Vultr VPS将用 Typescript 编写的 Discord.js 机器人部署到 Vultr VPS
【发布时间】:2022-08-03 09:34:31
【问题描述】:

我正在尝试使用 Vultr 托管一个不和谐的机器人,并且我正在尝试使用 PM2。我遵循了本指南:https://www.writebots.com/discord-bot-hosting/

我在最后一步,使用命令启动机器人:pm2 index.ts,但我不断收到此错误:


[PM2][ERROR] Interpreter /usr/local/lib/node_modules/pm2/node_modules/.bin/ts-node is NOT AVAILABLE in PATH. (type \'which /usr/local/lib/node_modules/pm2/node_modules/.bin/ts-node\' to double check.)

我已经修改了 package.json 以将 index.ts 作为 main 而不是像作者那样的 js,但这并没有改变任何东西。

我不知道我可以提供哪些有用的进一步信息,但如果您要求某些东西,我绝对可以提供。我不确定如何问这个问题,所以我尽力了。

    标签: node.js typescript discord.js vps vultr


    【解决方案1】:

    is NOT AVAILABLE in PATH 表示您尝试使用的可执行文件不在路径变量的文件夹中

    如果您将代码部署为 docker 映像或将 pm2/typescript 命令添加到您的路径,这可能会更容易

    【讨论】:

      猜你喜欢
      • 2020-03-02
      • 2021-07-11
      • 2019-02-16
      • 1970-01-01
      • 1970-01-01
      • 2021-02-19
      • 1970-01-01
      • 1970-01-01
      • 2011-11-02
      相关资源
      最近更新 更多