> For the complete documentation index, see [llms.txt](https://anidiotsguide.gitbook.io/master/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://anidiotsguide.gitbook.io/master/common-errors.md).

# 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.

![They have friends](https://1462412724-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-LAEeOAJ8-CJPfZkGKqI-887967055%2Fuploads%2Fgit-blob-100d68af1e9b22cace05a1e42ad4fa76f958f6b3%2Feditorhelp.png?alt=media)

You can check out [Installing and Using a Proper Editor](/master/other-guides/installing-and-using-a-proper-editor.md) to help in at least knowing there are errors *before* running your bot code.
