Skip to main content
Version: 11.x

配置

pnpm 使用 [npm 的配置] 格式。因此,你应该像设置 npm 一样设置配置。例如,

🌐 pnpm uses npm's configuration formats. Hence, you should set configuration the same way you would for npm. For example,

pnpm config set store-dir /path/to/.pnpm-store

如果没有配置存储,pnpm 将会自动在同一驱动器上创建一个存储。如果你需要 pnpm 在多个硬盘或文件系统间工作,请阅读[常见问题解答]。

🌐 If no store is configured, then pnpm will automatically create a store on the same drive. If you need pnpm to work across multiple hard drives or filesystems, please read the FAQ.

此外,pnpm 使用与 npm 相同的配置来进行安装。如果你有私有注册表,并且 npm 已配置为可以使用它,pnpm 也应该能够授权请求,无需额外配置。

🌐 Furthermore, pnpm uses the same configuration that npm uses for doing installations. If you have a private registry and npm is configured to work with it, pnpm should be able to authorize requests as well, with no additional configuration.

除了这些选项之外,pnpm 还允许你将所有作为标志的参数(例如 --filter--workspace-concurrency)用作选项:

🌐 In addition to those options, pnpm also allows you to use all parameters that are flags (for example --filter or --workspace-concurrency) as options:

workspace-concurrency = 1
filter = @my-scope/*

有关更多信息,请参见[config命令]。

🌐 See the config command for more information.