pnpm create

从 create-* 或 @foo/create-* 启动套件创建一个项目。

pnpm create <name> [<args>...]

该名称会映射到一个起始套件包:

名称 软件包
foo create-foo
create-foo create-foo
@scope @scope/create
@scope/foo @scope/create-foo

pnpm runs the starter kit with pnx and passes the remaining arguments to it.

示例#

pnpm create vite my-app

配置项#

--allow-build#

允许在安装期间执行安装的包名列表。 Repeat the option or, since v12.23.0, separate names with commas.

--shell-mode, -c#

在 shell 中运行该命令。 Uses /bin/sh on UNIX and cmd.exe on Windows.

--cpu=#

覆盖要安装的本机模块的 CPU 架构。可接受的值与 package.json 中的 cpu 字段相同,这个字段来自 process.arch。

--os=<name>#

覆盖本机的 OS 原生安装。可接受的值与 package.json 中的 os 字段相同,这个字段来自 process.platform。

--libc=<name>#

覆盖要安装的原生模块的 libc。可接受的值与 package.json 中的 libc 字段相同。

安全和信任政策#

pnpm create honors the project-level security and trust policy settings when resolving and fetching the starter kit. These include minimumReleaseAge, minimumReleaseAgeExclude, minimumReleaseAgeStrict, trustPolicy, trustPolicyExclude, and trustPolicyIgnoreAfter.