Can't get discord.js bot to launch

Hello, brand new glitch user here. I have a discord bot that I can’t get to automatically launch. I’ve boosted it as well still no go.

Here is my package.json file

`{
  "name": "havoc-music-bot",
  "version": "1.0.0",
  "main": "index.js",
  "author": "Evident",
  "license": "MIT",
  "engines": { "node": "12.0.0" },
  "dependencies": {
    "@discordjs/opus": "^0.3.2",
   "discord-player": "github:Androz2091/discord-player#develop",
    "discord.js": "^12.2.0",
    "scripts": {
      "start": "node index.js"
    }
  }
}`

The error is:

Here is a link to a remix of the bot: https://glitch.com/edit/#!/music-bot-examp

Any ideas what could be causing the issue?

P.S. it launches fine when I run node index.js from the terminal, till I close the window and it stops right away.

Hey @Evident,

Looks like your start script is inside the dependences field. This should solve it:

{
  "name": "havoc-music-bot",
  "version": "1.0.0",
  "main": "index.js",
  "author": "Evident",
  "license": "MIT",
  "engines": { "node": "12.0.0" },
  "dependencies": {
    "@discordjs/opus": "^0.3.2",
    "discord-player": "github:Androz2091/discord-player#develop",
    "discord.js": "^12.2.0"
  }, 
  "scripts": {
     "start": "node index.js"
  }
}

Hope this helps!

:man_facepalming: Thanks! I knew I was doing something stupid and just needed a second set of eyes on it lol.

1 Like