# Errors

### Disallowed Intents

This error happens when you don't enable required Gateway Intents on [Discord Developer Portal](https://discord.com/developers/applications).&#x20;

**How to fix:** Visit [Bot Application Setup](https://nidzo-docs.gitbook.io/ticketsbot/installation-and-setup/app-setup) Page, and follow steps **2** & **3**.

{% code overflow="wrap" %}

```yaml
Error [DisallowedIntents]: Privileged intent provided is not enabled or whitelisted.
```

{% endcode %}

### node:events

This error happens when you're using unsupported NodeJS Version (Older than 16.9).

**How to fix:** Visit [Dependencies](https://nidzo-docs.gitbook.io/ticketsbot/installation-and-setup/requirements) Page, and follow step 1 (1.2) - Only if you're hosting it on Linux Server, if you've purchased Server from Hosting, then you have to contact them on how to change NodeJS Version.

{% code overflow="wrap" %}

```yaml
Error: Cannot find module 'node:events'
```

{% endcode %}

### The module was compiled against.. <a href="#module-compile-error" id="module-compile-error"></a>

This error happens when you're use one NodeJS Version to install node\_modules and then start bot with some other.

**How to fix:** Delete `node_modules` folder and use the correct version to reinstall modules.

{% code overflow="wrap" %}

```yaml
Error: The module '...'
was compiled against a different Node.js version using
NODE_MODULE_VERSION 83. This version of Node.js requires
NODE_MODULE_VERSION 102. Please try re-compiling or re-installing
the module (for instance, using `npm rebuild` or `npm install`).
```

{% endcode %}

### Error: Cannot find module '...' <a href="#module-not-found" id="module-not-found"></a>

This error happens when you don't have module(s) installed.

**How to fix:** If you're hosting bot on Linux machine you can follow [Linux Installation Setup](https://nidzo-docs.gitbook.io/ticketsbot/installation-and-setup/linux-installation) Guide, if you're hosting on Pterodactyl or other panel, you'll probably just have to Start Bot.

{% code overflow="wrap" %}

```yaml
Error: Cannot find module '...'
...
code: 'MODULE_NOT_FOUND'
```

{% endcode %}

### Supplied roles is not a Role.

This error happens when you put invalid Role ID/Name into Config Field.

**How to fix:** Try to find the most recent changes you did to some config field which has to do with Role(s) ID/Name.

{% code overflow="wrap" %}

```yaml
TypeError [InvalidType]: Supplied roles is not a Role, Snowflake 
or Array or Collection of Roles or Snowflakes.
```

{% endcode %}

### Invalid OAuth2 redirect\_uri <a href="#oauth2-redirect-error" id="oauth2-redirect-error"></a>

This error happens when you didn't [setup Redirect URL on Discord Developer Portal](https://nidzo-docs.gitbook.io/ticketsbot/other/dashboard-setup) properly (or didn't at all) or you didn't specify the it right in config.yml.

**How to fix:** Make sure that you followed the right format for URL. URL must start with `https://` or `http://` (depending on your hosting & setup), after that should be your domain/IP & at the end there should be `:PORT` (`PORT` being `port` config.yml field). When adding URL Redirect on Discord Developer Portal you also have to add `/callback` to the end of URL, while URL in config should be without it at the end.

config.yml URL field Examples

{% code overflow="wrap" %}

```yaml
https://yourdomain.com:3003
http://123.45.675.104:3003
https://yourdomain.com (when you setup domain yourself so domain is automatically included)
```

{% endcode %}

Discord Developer Portal URL Redirect Examples

{% code overflow="wrap" %}

```
https://yourdomain.com:3003/callback
http://123.45.675.104:3003/callback
https://yourdomain.com/callback (when you setup domain yourself so domain is automatically included)
```

{% endcode %}
