remotion-dev/remotion · error · Error

No lockfile was found in your project (one of ${StudioServer

Error message

No lockfile was found in your project (one of ${StudioServerInternals.lockFilePaths.map((p) => p.path).join(', ')}). Install dependencies using your favorite manager!

What it means

`addCommand` calls `StudioServerInternals.getPackageManager` which inspects `lockFilePaths`. If no recognized lockfile is found, the manager resolves to 'unknown' and the command aborts, listing the candidate lockfile paths it searched for. Without a lockfile it cannot decide which install command (npm/yarn/pnpm/bun) to run.

Source

Thrown at packages/cli/src/add.ts:152

	} 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,
	});

	if (manager === 'unknown') {
		throw new Error(
			`No lockfile was found in your project (one of ${StudioServerInternals.lockFilePaths
				.map((p) => p.path)
				.join(', ')}). Install dependencies using your favorite manager!`,
		);
	}

	const packagesWithVersions = toInstall.map((pkg) => {
		if (EXTRA_PACKAGES[pkg]) {
			return `${pkg}@${EXTRA_PACKAGES[pkg]}`;
		}

		return `${pkg}@${targetVersion}`;
	});

	const command = StudioServerInternals.getInstallCommand({
		manager: manager.manager,
		packages: packagesWithVersions,
		version: '',

View on GitHub (pinned to 78fe4bb3fd)

Solutions

  1. Run an install once with your package manager to generate a lockfile (npm install / yarn / pnpm install / bun install).
  2. Run `remotion add` from the project root where the lockfile lives.
  3. Pass `--package-manager` if the CLI supports it to bypass detection.
  4. Ensure your package manager's lockfile name is among the recognized formats.

Example fix

// before
# no lockfile present
npx remotion add @remotion/shapes

# after
npm install   # creates package-lock.json
npx remotion add @remotion/shapes
Defensive patterns

Strategy: validation

Validate before calling

import fs from 'node:fs';
function hasLockfile(root: string): boolean {
  return ['package-lock.json','yarn.lock','pnpm-lock.yaml','bun.lockb']
    .some(f => fs.existsSync(`${root}/${f}`));
}

Type guard

const projectHasLockfile = (root: string): boolean =>
  ['package-lock.json','yarn.lock','pnpm-lock.yaml','bun.lockb']
    .some(f => fs.existsSync(`${root}/${f}`));

Try / catch

try { await addCommand({...}); }
catch (e) {
  if (e instanceof Error && /No lockfile was found/.test(e.message)) {
    await runInstall(); // generates a lockfile
  }
}

Prevention

When it happens

Trigger: Running `remotion add` in a project with no package-lock.json, yarn.lock, pnpm-lock.yaml, or bun.lockb; the project uses an unsupported/unknown lockfile; the lockfile is outside the searched directory chain (dirUp: 0 means only the root).

Common situations: Fresh project that never ran an install; lockfile deleted/gitignored and not regenerated; running from a subdirectory rather than the project root; using a package manager whose lockfile name isn't in lockFilePaths.

Related errors


AI-assisted analysis of remotion-dev/remotion@78fe4bb3fd (2026-08-12). Data as JSON: /api/errors/ab2ac7eeb35d1f4e. Report an issue: GitHub.