npx remotion add
将一个或多个 Remotion 软件包添加到你的项目中,版本与你的其他 Remotion 软件包相同。
🌐 Adds one or more Remotion packages to your project with the same version as your other Remotion packages.
还支持为你的 Remotion 安装添加 zod 和 mediabunny 的正确版本。
🌐 Also supports adding zod and mediabunny with the correct version for your Remotion installation.
npx remotion add <package-name...>示例
🌐 Examples
添加一个包:
🌐 Add a single package:
npx remotion add @remotion/transitions一次添加多个软件包:
🌐 Add multiple packages at once:
npx remotion add @remotion/transitions @remotion/three @remotion/lottie此命令将会:
🌐 This command will:
- 验证所有包名称都是有效的 Remotion 包(或支持的额外包:
zod、mediabunny) - 检查哪些软件包已经安装(并跳过它们)
- 检测你当前安装的 Remotion 软件包的版本
- 安装具有匹配版本的指定软件包
标志
🌐 Flags
--package-managerv4.0.367
Forces a specific package manager to be used. By default, Remotion will auto-detect the package manager based on your lockfile.Acceptable values are
npm, yarn, pnpm and bun.
包管理器支持
🌐 Package manager support
npm、yarn 和 pnpm 都支持。
附加参数
🌐 Additional arguments
你传递给此命令的任何附加参数将在包名称之前作为标志转发给包管理器。
🌐 Any additional arguments you pass to this command will be forwarded as flags to the package manager, before the package name.
用例
🌐 Use case
当你想向项目添加新的 Remotion 包并确保它们与其他 Remotion 包安装相同版本时,此命令非常有用。这有助于避免可能导致兼容性问题的版本不匹配。
🌐 This command is useful when you want to add new Remotion packages to your project and ensure they're installed with the same version as your other Remotion packages. This helps avoid version mismatches that could cause compatibility issues.
例如,如果你已经安装了 remotion@4.0.100 并且你想添加 @remotion/transitions,运行 npx remotion add @remotion/transitions 将会安装 @remotion/transitions@4.0.100。
🌐 For example, if you have remotion@4.0.100 installed and you want to add @remotion/transitions, running npx remotion add @remotion/transitions will install @remotion/transitions@4.0.100.
在添加多个软件包时,该命令会在一次操作中安装它们所有,并使用相同的版本号。
🌐 When adding multiple packages, the command will install all of them in a single operation with the same version number.
另请参阅
🌐 See also