{"record":{"id":"01ef88f53eda4c95","repo":"remotion-dev/remotion","slug":"no-remotion-packages-found-in-your-project-instal","errorCode":null,"errorMessage":"No Remotion packages found in your project. Install Remotion first.","messagePattern":"No Remotion packages found in your project\\. Install Remotion first\\.","errorType":"exception","errorClass":"Error","httpStatus":null,"severity":"error","filePath":"packages/cli/src/add.ts","lineNumber":138,"sourceCode":"\tif (installedRemotionPackages.length > 0) {\n\t\ttry {\n\t\t\tconst packageJson = require(packageJsonPath);\n\t\t\ttargetVersion = packageJson.version;\n\t\t\tconst packageList =\n\t\t\t\ttoInstall.length === 1\n\t\t\t\t\t? toInstall[0]\n\t\t\t\t\t: `${toInstall.length} packages (${toInstall.join(', ')})`;\n\t\t\tLog.info({indent: false, logLevel}, `Installing ${packageList}`);\n\t\t} catch (err) {\n\t\t\tthrow new Error(\n\t\t\t\t`Could not determine version of installed Remotion packages: ${(err as Error).message}`,\n\t\t\t);\n\t\t}\n\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);","sourceCodeStart":120,"sourceCodeEnd":156,"githubUrl":"https://github.com/remotion-dev/remotion/blob/78fe4bb3fdb5a2cd68724393d63cb223db333fa7/packages/cli/src/add.ts#L120-L156","documentation":"When no Remotion package is detected as installed (`installedRemotionPackages` empty), `addCommand` only permits installing `EXTRA_PACKAGES`. Any requested package that is not an extra is collected into `notExtraPackages`, and if non-empty, the error is thrown telling the user to install Remotion first.","triggerScenarios":"Running `npx remotion add @remotion/<core-pkg>` in a project that has no Remotion packages installed yet; running in a fresh/empty directory; node_modules cleared but trying to add a Remotion dep before installing `remotion` or `@remotion/cli`.","commonSituations":"New project that hasn't run the Remotion starter; wrong working directory (not the project root); dependencies never installed after cloning.","solutions":["Initialize Remotion first: `npx create-video@latest` or `npm install remotion @remotion/cli`.","Ensure you run the command from the project root where Remotion is installed.","Run `npm install` (or your manager) to populate node_modules before `remotion add`.","Only use `remotion add` for extra packages once a core Remotion package exists."],"exampleFix":"// before\n// in a project with no remotion installed\nnpx remotion add @remotion/shapes\n\n// after\nnpm install remotion @remotion/cli\nnpx remotion add @remotion/shapes","handlingStrategy":"validation","validationCode":"function hasRemotionInstalled(deps: Record<string,string>): boolean {\n  return Object.keys(deps).some(k => k === 'remotion' || k.startsWith('@remotion/'));\n}","typeGuard":"const projectHasRemotion = (pkg: {dependencies?: Record<string,string>; devDependencies?: Record<string,string>}): boolean =>\n  [...Object.keys(pkg.dependencies ?? {}), ...Object.keys(pkg.devDependencies ?? {})]\n    .some(k => k === 'remotion' || k.startsWith('@remotion/'));","tryCatchPattern":"try { await addCommand({...}); }\ncatch (e) {\n  if (e instanceof Error && /Install Remotion first/.test(e.message)) {\n    await bootstrapRemotion();\n  }\n}","preventionTips":["Bootstrap with create-video or install remotion + @remotion/cli first.","Run remotion add from the project root.","Install dependencies after cloning."],"tags":["cli","add","packages","setup","bootstrap"],"backgroundTag":null,"analyzedSha":"78fe4bb3fdb5a2cd68724393d63cb223db333fa7","analyzedAt":"2026-08-12T17:18:50.444Z","schemaVersion":2},"datasetVersion":"2026-08-12T23:17:12.415Z"}