create-remix
create-react-router
CLI 来启动新项目。
create-remix
CLI 将创建一个新的 Remix 项目。如果不传递参数,此命令将启动一个交互式 CLI 来配置新项目并在给定目录中设置它。
npx create-remix@latest
或者,您可以将所需的目录路径作为参数传递
npx create-remix@latest <projectDir>
默认应用程序是使用内置 Remix App Server 的 TypeScript 应用程序。如果您希望基于不同的设置创建应用程序,则可以使用 --template
标志
npx create-remix@latest --template <templateUrl>
要获取可用命令和标志的完整列表,请运行
npx create-remix@latest --help
create-remix
也可以使用各种包管理器调用,允许您在 npm、Yarn、pnpm 和 Bun 之间进行选择来管理安装过程。
npm create remix@latest <projectDir>
# or
yarn create remix@latest <projectDir>
# or
pnpm create remix@latest <projectDir>
# or
bunx create-remix@latest <projectDir>
create-remix --template
有关可用模板的更全面指南,请参阅我们的模板页面。
一个有效的模板可以是
:username/:repo
或 :username/:repo/:directory
https://github.com/:username/:repo
或 https://github.com/:username/:repo/tree/:branch/:directory
:branch
) 不能包含 /
,因为 create-remix
无法区分分支名称和目录路径https://example.com/remix-template.tar.gz
./path/to/remix-template
./path/to/remix-template.tar.gz
npx create-remix@latest ./my-app --template remix-run/grunge-stack
npx create-remix@latest ./my-app --template remix-run/remix/templates/remix
npx create-remix@latest ./my-app --template remix-run/examples/basic
npx create-remix@latest ./my-app --template :username/:repo
npx create-remix@latest ./my-app --template :username/:repo/:directory
npx create-remix@latest ./my-app --template https://github.com/:username/:repo
npx create-remix@latest ./my-app --template https://github.com/:username/:repo/tree/:branch
npx create-remix@latest ./my-app --template https://github.com/:username/:repo/tree/:branch/:directory
npx create-remix@latest ./my-app --template https://github.com/:username/:repo/archive/refs/tags/:tag.tar.gz
npx create-remix@latest ./my-app --template https://github.com/:username/:repo/releases/latest/download/:tag.tar.gz
npx create-remix@latest ./my-app --template https://example.com/remix-template.tar.gz
npx create-remix@latest ./my-app --template ./path/to/remix-template
npx create-remix@latest ./my-app --template ./path/to/remix-template.tar.gz
create-remix --overwrite
如果 create-remix
检测到模板和您要在其中创建应用程序的目录之间存在任何文件冲突,它将提示您确认是否可以接受使用模板版本覆盖这些文件。您可以使用 --overwrite
CLI 标志跳过此提示。