选择命令行版本:
🌐 Synopsis
npm set <key>=<value> [<key>=<value> ...] (See `npm config`)
注意:此命令不支持工作区。
🌐 Note: This command is unaware of workspaces.
🌐 Description
在 npm 配置中设置一个值
🌐 Set a value in the npm configuration
🌐 Configuration
global以“全局”模式运行,因此软件包会安装到 prefix 文件夹中,而不是当前工作目录。有关行为差异的更多信息,请参见 folders。
🌐 Operates in "global" mode, so that packages are installed into the prefix folder instead of the current working directory. See folders for more on the differences in behavior.
{prefix}/lib/node_modules 文件夹中,而不是当前工作目录。{prefix}/bin 关联{prefix}/share/manlocation--global,否则为 "user",传入后该值也会设置为 "global"当传递给 npm config 时,这指的是使用哪个配置文件。
🌐 When passed to npm config this refers to which config file to use.
当设置为“全局”模式时,软件包会安装到 prefix 文件夹,而不是当前工作目录。有关行为差异的更多信息,请参见 文件夹。
🌐 When set to "global" mode, packages are installed into the prefix folder instead of the current working directory. See folders for more on the differences in behavior.
{prefix}/lib/node_modules 文件夹中,而不是当前工作目录。{prefix}/bin 关联{prefix}/share/man🌐 See Also