Skip to main content
An INVALID_DEPENDENCY error means Virtus Cloud could not locate or parse your application’s dependency file during the deployment build step. Without a valid dependency manifest, the platform has no way to know which packages to install — so the build fails before your application ever starts. This error is almost always caused by a missing file or a subtle naming mistake, both of which are quick to fix once you know what to look for.

When Does It Occur?

The error appears in your deployment logs before your application process starts, during the dependency installation phase. It typically looks like:
[SQUARE-SHIELD] INVALID_DEPENDENCY
Your application will not start until the dependency file issue is resolved and you trigger a new deployment.

Why Does It Occur?

The most common causes are:
  • The dependency file (package.json or requirements.txt) doesn’t exist in the root directory of your project — it may be inside a subdirectory.
  • The file was inadvertently saved with a double extension, such as package.json.txt or requirements.txt.txt. This often happens when creating the file in a text editor on Windows with hidden file extensions.
  • The file exists but contains a syntax error that prevents it from being parsed.
  • You uploaded your project without including the dependency file at all.

How to Fix It

1

Navigate to your project's root directory

Make sure you’re working in the top-level folder of your application — the same directory that contains your main JavaScript file.
2

Check whether package.json exists

Confirm that a package.json file is present in the root. If it’s missing, create one with the following command:
npm init -y
This generates a default package.json with your project’s name, version, and an empty dependencies section.
3

Verify the filename

Ensure the file is named exactly package.json — lowercase, with no extra extensions. On Windows, enable “Show file extensions” in File Explorer to confirm the full filename is not package.json.txt.
4

Validate the JSON syntax

Open package.json in a text editor and confirm it is valid JSON. A common mistake is a trailing comma after the last item in an object or array. You can paste the file contents into jsonlint.com to check for syntax errors.
package.json
{
  "name": "my-app",
  "version": "1.0.0",
  "main": "index.js",
  "dependencies": {
    "discord.js": "^14.14.1"
  }
}
5

Redeploy your application

Upload the corrected package.json to the root of your project and redeploy. Virtus Cloud will re-run the install step and install all listed packages.

Additional Tips

File extension mistakes are the single most common cause of this error. Always verify the full filename — including the extension — before uploading. Most operating systems hide extensions by default, which can lead to inadvertently creating requirements.txt.txt.
Virtus Cloud looks for the dependency file in the root of your uploaded project. If your package.json is inside a src/ or backend/ subdirectory, the platform won’t find it. Move it to the top level.
Ensure that every package name in your dependency file is spelled correctly and matches the name on npmjs.com or pypi.org exactly. A typo will also trigger this error class.
If you continue to experience INVALID_DEPENDENCY errors after verifying your dependency file, contact the Virtus Cloud support team.