critical node
In the console
Cannot find module 'module'
Error [ERR_MODULE_NOT_FOUND]: Cannot find package 'module'
MODULE_NOT_FOUND
Node.js could not find a module. If the name is a package, it was never installed (node_modules is missing or incomplete). If it is a path, the main file or an import points to a file that does not exist.
How to fix it
- If it is a package: make sure package.json lists it, then restart so the egg runs npm install (or add it to the 'additional node packages' startup variable).
- If node_modules was uploaded from Windows or macOS, delete it and let the server reinstall dependencies on Linux.
- If it is a path (starts with ./ or /home/container), check the main file startup variable and the import path, including capitalisation.
error node
In the console
ERR_REQUIRE_ESM
require() of ES Module
The code uses require() for a package that is now published as an ES module only (common after major upgrades of packages such as node-fetch, chalk or got).
How to fix it
- Pin the package to its last CommonJS version in package.json (for example node-fetch@2 or chalk@4), or
- Switch your code to ES modules ("type": "module" in package.json and import syntax), or use a dynamic import().
error node
In the console
Cannot use import statement outside a module
The file uses import/export syntax but Node.js treats it as CommonJS.
How to fix it
- Add "type": "module" to package.json, or rename the file to .mjs, or
- Change import to require() if the project is meant to be CommonJS.
critical node
In the console
JavaScript heap out of memory
Reached heap limit Allocation failed
Ineffective mark-compacts near heap limit
V8 hit its heap limit. Either the app needs more than the default limit, or it keeps data it never frees (caches without limits, growing arrays, listeners added repeatedly).
How to fix it
- Raise the limit with --max-old-space-size (in MB, for example node --max-old-space-size=1536 index.js), keeping it below the server's memory limit.
- Watch memory in the Performance tab: a steady climb is a leak; look at caches and event listeners.
- For Discord bots, limit cache sizes (makeCache / sweepers in discord.js).
error node
In the console
UnhandledPromiseRejection
Unhandled promise rejection
triggerUncaughtException
An async operation failed and nothing caught the error. Since Node.js 15 this terminates the process.
How to fix it
- Read the error printed above for the real cause (network, permissions, invalid data).
- Wrap the failing await in try/catch, or add .catch() to the promise.
- Add a process.on('unhandledRejection') handler that logs errors so one failure does not take the whole app down.
critical node
In the console
SyntaxError: message
Node.js could not parse a file: message. Either the file has a typo, or it uses syntax that this Node.js version does not support yet (for example ??=, ?. or top-level await on old versions).
How to fix it
- Open the file and line shown above the error and fix the syntax.
- If the code is from a package or tutorial, check its required Node.js version and pick a matching Docker image on the Startup page.
error node
In the console
The engine "node" is incompatible with this module
Unsupported engine
requires Node version
A package declares that it needs another Node.js version (see the message).
How to fix it
- Choose a Docker image with a supported Node.js version on the Startup page (current LTS versions are the safest choice).
- Or install an older version of the package that supports your Node.js version.
critical node
In the console
npm ERR! ENOENT … package.json
Could not read package.json
no such file or directory, open ' … package.json'
npm ran in a folder without package.json, so dependencies cannot be installed. The project files were uploaded into a subfolder, or not uploaded at all.
How to fix it
- Make sure package.json is in the server's root folder (/home/container), not inside a subfolder from an archive.
- If you use git deployment, check the repository and branch startup variables.
error node
In the console
npm ERR! code code
npm ERR! ERESOLVE
Installing dependencies failed. ERESOLVE means conflicting peer dependencies, ETARGET/E404 a version that does not exist, ECONNRESET/ETIMEDOUT network trouble, EACCES permissions.
How to fix it
- Read the npm error lines below this one for the package that failed.
- For ERESOLVE, align the conflicting versions in package.json (or use --legacy-peer-deps if you accept the risk).
- Delete node_modules and package-lock.json if they came from another machine, then restart.
error node
In the console
gyp ERR!
node-pre-gyp ERR!
was compiled against a different Node.js version using NODE_MODULE_VERSION built
A package with native code (sqlite3, bcrypt, canvas, sharp...) could not download a prebuilt binary and could not compile one, or it was built for another Node.js version.
How to fix it
- Delete node_modules and reinstall after changing Node.js versions.
- Switch to a pure-JavaScript alternative where possible (bcryptjs instead of bcrypt, better-sqlite3 prebuilds).
- Use a Node.js version for which the package publishes prebuilt binaries.
critical node python discord
In the console
An invalid token was provided
TokenInvalid
TOKEN_INVALID
LoginFailure: Improper token has been passed
Discord rejected the bot token. It was mistyped, regenerated in the Developer Portal, or it is a user/client secret instead of the bot token.
How to fix it
- Open the Discord Developer Portal > your application > Bot, and reset the token.
- Paste the new token into the bot's config or startup variable without quotes or spaces.
- Never share the token; if it was posted anywhere public, reset it again.
Links: Discord Developer Portal
critical node python discord
In the console
Used disallowed intents
DisallowedIntents
PrivilegedIntentsRequired
The bot asks for privileged gateway intents (Message Content, Server Members or Presence) that are switched off for the application.
How to fix it
- Developer Portal > your application > Bot > Privileged Gateway Intents: enable the ones the bot requests.
- Or remove those intents from the bot's code if it does not need them.
- Bots in 100+ servers need Discord's approval for privileged intents.
error node python discord
In the console
DiscordAPIError[50013]
error code: 50013
DiscordAPIError: Missing Permissions
DiscordAPIError[50001]: Missing Access
Discord refused an action because the bot's role lacks a permission, or its role is below the role/user it tries to manage, or it cannot see the channel.
How to fix it
- Give the bot's role the permission it needs in Server Settings > Roles, or in the channel's permission overrides.
- Move the bot's role above the roles it should manage.
- Re-invite the bot with the right permission scope if needed.
warning node python discord
In the console
429 Too Many Requests
You are being rate limited
RateLimitError
We are being rate limited
The app sent too many requests and the API (often Discord) is making it wait. Repeated global rate limits can get the bot or IP temporarily banned.
How to fix it
- Avoid loops that send messages, edit roles or fetch members repeatedly.
- Cache data instead of re-fetching it, and add delays to bulk actions.
- Check whether the bot restarts in a loop and logs in again each time (each login counts).
warning discord
In the console
DiscordAPIError[10062]
(error code: 10062)
Unknown interaction
The bot answered a slash command, button or menu after Discord's 3-second window (or answered one it had already lost), so Discord rejected it and users saw 'The application did not respond'. Slow code before the reply, a busy or overloaded host, or two copies of the bot running with the same token are the usual causes.
How to fix it
- Call deferReply() (discord.js) or interaction.response.defer() (discord.py) straight away, then do the slow work and use editReply/followup.
- Make sure only one copy of the bot is running: a second instance on another host answers first and the other gets this error.
- If it happens under load, check the server's CPU usage and the bot's event loop for blocking work.
warning discord
In the console
DiscordAPIError[40060]
(error code: 40060)
Interaction has already been acknowledged
The bot tried to reply to an interaction it had already replied to or deferred. It is a bug in the bot's code (two handlers for the same command, or reply() after deferReply()), or two copies of the bot running at once.
How to fix it
- After deferReply() or a first reply, use editReply() or followUp() instead of reply().
- Check that the command is not registered or handled twice.
- Make sure only one copy of the bot runs with this token.
error node
In the console
ReferenceError: fetch is not defined
The code calls fetch(), which only exists built in from Node.js 18. The server's Docker image runs an older Node.js.
How to fix it
- In the server's Startup tab, pick a Docker image with Node.js 18 or newer (20 or 22 recommended) and restart.
- If you must stay on old Node.js, install node-fetch and import it, but upgrading is the better fix.