{"record":{"id":"ab2ac7eeb35d1f4e","repo":"remotion-dev/remotion","slug":"no-lockfile-was-found-in-your-project-one-of-st","errorCode":null,"errorMessage":"No lockfile was found in your project (one of ${StudioServerInternals.lockFilePaths.map((p) => p.path).join(', ')}). Install dependencies using your favorite manager!","messagePattern":"No lockfile was found in your project \\(one of (.+?)\\)\\. Install dependencies using your favorite manager!","errorType":"exception","errorClass":"Error","httpStatus":null,"severity":"error","filePath":"packages/cli/src/add.ts","lineNumber":152,"sourceCode":"\t} else {\n\t\t// If no Remotion packages are installed, we can only install extra packages\n\t\tconst notExtraPackages = toInstall.filter((pkg) => !EXTRA_PACKAGES[pkg]);\n\t\tif (notExtraPackages.length > 0) {\n\t\t\tthrow new Error(\n\t\t\t\t'No Remotion packages found in your project. Install Remotion first.',\n\t\t\t);\n\t\t}\n\t}\n\n\tconst manager = StudioServerInternals.getPackageManager({\n\t\tremotionRoot,\n\t\tpackageManager,\n\t\tdirUp: 0,\n\t\tlogLevel,\n\t});\n\n\tif (manager === 'unknown') {\n\t\tthrow new Error(\n\t\t\t`No lockfile was found in your project (one of ${StudioServerInternals.lockFilePaths\n\t\t\t\t.map((p) => p.path)\n\t\t\t\t.join(', ')}). Install dependencies using your favorite manager!`,\n\t\t);\n\t}\n\n\tconst packagesWithVersions = toInstall.map((pkg) => {\n\t\tif (EXTRA_PACKAGES[pkg]) {\n\t\t\treturn `${pkg}@${EXTRA_PACKAGES[pkg]}`;\n\t\t}\n\n\t\treturn `${pkg}@${targetVersion}`;\n\t});\n\n\tconst command = StudioServerInternals.getInstallCommand({\n\t\tmanager: manager.manager,\n\t\tpackages: packagesWithVersions,\n\t\tversion: '',","sourceCodeStart":134,"sourceCodeEnd":170,"githubUrl":"https://github.com/remotion-dev/remotion/blob/78fe4bb3fdb5a2cd68724393d63cb223db333fa7/packages/cli/src/add.ts#L134-L170","documentation":"`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.","triggerScenarios":"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).","commonSituations":"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.","solutions":["Run an install once with your package manager to generate a lockfile (npm install / yarn / pnpm install / bun install).","Run `remotion add` from the project root where the lockfile lives.","Pass `--package-manager` if the CLI supports it to bypass detection.","Ensure your package manager's lockfile name is among the recognized formats."],"exampleFix":"// before\n# no lockfile present\nnpx remotion add @remotion/shapes\n\n# after\nnpm install   # creates package-lock.json\nnpx remotion add @remotion/shapes","handlingStrategy":"validation","validationCode":"import fs from 'node:fs';\nfunction hasLockfile(root: string): boolean {\n  return ['package-lock.json','yarn.lock','pnpm-lock.yaml','bun.lockb']\n    .some(f => fs.existsSync(`${root}/${f}`));\n}","typeGuard":"const projectHasLockfile = (root: string): boolean =>\n  ['package-lock.json','yarn.lock','pnpm-lock.yaml','bun.lockb']\n    .some(f => fs.existsSync(`${root}/${f}`));","tryCatchPattern":"try { await addCommand({...}); }\ncatch (e) {\n  if (e instanceof Error && /No lockfile was found/.test(e.message)) {\n    await runInstall(); // generates a lockfile\n  }\n}","preventionTips":["Run an install once to generate a lockfile before remotion add.","Run commands from the project root.","Pass an explicit package-manager flag if available."],"tags":["cli","add","package-manager","lockfile","setup"],"backgroundTag":null,"analyzedSha":"78fe4bb3fdb5a2cd68724393d63cb223db333fa7","analyzedAt":"2026-08-12T17:18:50.444Z","schemaVersion":2},"datasetVersion":"2026-08-12T18:17:37.767Z"}