> ## Knowledge Base Index
> Fetch the complete knowledge base index at: https://help.squarecloud.app/sitemap.xml
> Use this file to discover available pages before exploring further.
> Pure-Markdown content can be obtained by appending a '.md' suffix to the content URLs listed in the sitemap (without the trailing slash).

# MODULE_NOT_FOUND / Cannot find module: how to fix

## What this error means

Your application is trying to use a library that isn't installed in the environment. Depending on the language, the message looks like:

```
# JavaScript / Node.js
Error: Cannot find module 'discord.js'

# Python
ModuleNotFoundError: No module named 'discord'
```

## Why it happens

On Square Cloud, libraries are **not** installed by default — they have to be declared in your dependency file so the platform installs them during deploy. If a package is missing from that file (or was only installed locally on your computer), the app can't find it at runtime.

## How to fix it

Add the missing library to your dependency file and restart the application so it reinstalls everything.

**Node.js —&#32;`package.json`:**

```jsonc
{
  "dependencies": {
    "discord.js": "14.14.1"
  }
}
```

**Python —&#32;`requirements.txt`:**

```txt
discord.py
```

After updating the file, restart (or re-deploy) the application. The platform reads the dependency file and installs the listed packages.

## Quick checklist

* Is the library spelled exactly as published on npm/PyPI?
* Is it listed under `dependencies` (not only `devDependencies`)?
* Did you restart the app after editing the file?

## Related

If the dependency file itself can't be found, see [INVALID_DEPENDENCY: dependency file not found on deploy](https://help.squarecloud.app/en-us/article/invaliddependency-dependency-file-not-found-on-deploy-1hz83bl/). For native modules such as SQLite, see [Could not locate the bindings file: how to fix the better-sqlite3 error](https://help.squarecloud.app/en-us/article/could-not-locate-the-bindings-file-how-to-fix-the-better-sqlite3-error-j6uacg/).
