remotion-dev/remotion · error · Error
Could not determine version of installed Remotion packages:
Error message
Could not determine version of installed Remotion packages: ${(err as Error).message} What it means
When at least one Remotion package is already installed, `addCommand` resolves the installed package.json via `require(packageJsonPath)` to read `version`. If that require/parse throws (file missing, unreadable, or invalid JSON), the underlying error message is wrapped and re-thrown so the target install version cannot be determined.
Source
Thrown at packages/cli/src/add.ts:130
const installedRemotionPackages = listOfRemotionPackages.filter((pkg) =>
allDeps.includes(pkg),
);
// Get the version from the first installed Remotion package
const packageJsonPath = `${remotionRoot}/node_modules/${installedRemotionPackages[0]}/package.json`;
let targetVersion: string | null = null;
if (installedRemotionPackages.length > 0) {
try {
const packageJson = require(packageJsonPath);
targetVersion = packageJson.version;
const packageList =
toInstall.length === 1
? toInstall[0]
: `${toInstall.length} packages (${toInstall.join(', ')})`;
Log.info({indent: false, logLevel}, `Installing ${packageList}`);
} catch (err) {
throw new Error(
`Could not determine version of installed Remotion packages: ${(err as Error).message}`,
);
}
} else {
// If no Remotion packages are installed, we can only install extra packages
const notExtraPackages = toInstall.filter((pkg) => !EXTRA_PACKAGES[pkg]);
if (notExtraPackages.length > 0) {
throw new Error(
'No Remotion packages found in your project. Install Remotion first.',
);
}
}
const manager = StudioServerInternals.getPackageManager({
remotionRoot,
packageManager,
dirUp: 0,
logLevel,View on GitHub (pinned to 78fe4bb3fd)
Solutions
- Reinstall dependencies (delete node_modules and lockfile-install) to restore a valid package.json.
- Verify the installed Remotion package's package.json is valid JSON.
- Check filesystem permissions on node_modules.
- If a specific package is implicated, reinstall just that package.
Defensive patterns
Strategy: try-catch
Validate before calling
import fs from 'node:fs';
function installedVersionReadable(pkgJsonPath: string): boolean {
try {
JSON.parse(fs.readFileSync(pkgJsonPath, 'utf-8'));
return true;
} catch { return false; }
} Try / catch
try { await addCommand({...}); }
catch (e) {
if (e instanceof Error && /Could not determine version/.test(e.message)) {
await reinstallNodeModules();
}
} Prevention
- Keep node_modules intact; reinstall if corrupted.
- Validate package.json files are well-formed JSON.
- Check filesystem permissions before running add.
When it happens
Trigger: The installed Remotion package's package.json is missing, not readable, or contains invalid JSON; `resolveFrom` pointed at a path that does not exist; filesystem/permission issues; a corrupted node_modules.
Common situations: Corrupted or partially-deleted node_modules; manually edited package.json with syntax errors; permission errors reading the file; a broken symlink in node_modules.
Related errors
- The following packages are not Remotion packages: ${invalidP
- No Remotion packages found in your project. Install Remotion
- No lockfile was found in your project (one of ${StudioServer
- ${result.file} was chosen as the entry point (reason = ${res
- ${result.file} was chosen as the entry point (reason = ${res
AI-assisted analysis of remotion-dev/remotion@78fe4bb3fd (2026-08-12).
Data as JSON: /api/errors/a33f4a13ebf07e86.
Report an issue: GitHub.