Home
  • Welcome
  • Frequently Asked Questions
  • Common Errors
  • Getting Started
    • Getting Started - Long Version
    • Getting Started - TL;DR
  • First Bot
    • Your First Bot
    • Adding a Config File
    • Command with arguments
    • A Basic Command Handler
    • A Better Basic Command Handler
    • Using Embeds in messages
  • Coding Guides
    • SQLite-Based Points System
    • Cleverbot Integration
    • Using Emojis
    • Making a Starboard
    • Tracking Used Invites
    • Using Audit Logs
  • Understanding
    • Events and Handlers
    • Collections
    • Roles and Permissions
    • Sharding
  • Examples
    • Making an Eval command
    • Miscellaneous Examples
  • Discord Webhooks
    • Webhooks (Part 1)
    • Webhooks (Part 2)
    • Webhooks (Part 3)
  • Video Guides
  • Other Guides
    • Installing and Using Atom
    • Using Git to share and update code
    • Using Environment Variables
    • Async / Await
Powered by GitBook
On this page
  • Cannot find module discord.js
  • Problem:
  • Solution:
  • Error: getaddrinfo ENOTFOUND gateway.discord.gg gateway.discord.gg:443
  • Problem:
  • Solution:
  • Unexpected End of Input
  • Problem:
  • Solution:

Common Errors

Cannot find module discord.js

Problem:

You didn't install Discord.js or installed it in the wrong folder.

Solution:

  • Make sure you are in the correct folder where you have your bot's files

  • SHIFT+Right-Click in the folder and select Open command window here

  • Run npm init -y, and hit enter until the wizard is complete

  • Run npm i discord.js again to install Discord.

Error: getaddrinfo ENOTFOUND gateway.discord.gg gateway.discord.gg:443

Problem:

Your internet went down.

Solution:

Get better, more stable internet, or host your bot on a VPS.

Unexpected End of Input

Problem:

});
^
SyntaxError: Unexpected end of input

Solution:

Your code has an error somewhere. This is impossible to troubleshoot without the complete code, since the error can be anywhere (in fact the error stack often tells you it's at the end of your code).

The following trick is a lifesaver, so pay attention: Your code editor is trying to help you. Whatever editor you're using (except notepad++.exe. Don't use notepad++!), clicking on any (and I mean any) special character such as parentheses, square brackets, curly braces, double and single quotes, will automatically highlight the one that matches it. The screenshot below shows this: I clicked on the curly brace at the bottom, it shows me the one on top by highlighting it. Learn this, and how different functions and event handlers "look" like.

PreviousFrequently Asked QuestionsNextGetting Started

Last updated 3 years ago

You can check out to help in at least knowing there are errors before running your bot code.

Installing and Using a Proper Editor
They have friends