Fix a missing module

RunUpdated

Python may stop with ModuleNotFoundError. Node may report MODULE_NOT_FOUND, ERR_MODULE_NOT_FOUND, or Cannot find module. Read the first missing package or path in the console before changing your files.

A package is missing

For Python, list the required package in requirements.txt and upload that file beside your source. For Node, list runtime packages under dependencies in package.json. Development dependencies are skipped at startup, so a package used by the running bot must be a production dependency. Upload your lockfile if you have one, then restart and read the dependency installation output.

Package distribution names and import names can differ. Check the package's official installation instructions rather than installing a similarly named package. Avoid uploading a local node_modules folder or virtual environment: it may contain binaries built for another operating system.

A local file is missing

Check that the file was uploaded and that the import matches its exact spelling and capitalization. Paths that work on a case-insensitive laptop can fail on the server. Confirm the configured main file points at your uploaded entry file. If you deploy compiled code, upload the build output as well as its runtime dependencies.

Read the earlier error

A failed package installation may be the underlying problem. Scroll above the missing-module line for a download, version, build, disk, or memory failure. Fix that earlier error before restarting again. Do not paste tokens or environment values into support messages.

Once the bot starts, exercise the command that imported the missing package. Some imports run only when a command is used. The Node deployment guide and Python deployment guide explain dependency installation and entry files.

Still stuck? Contact support