npm-install-test
选择命令行版本:
See Details
目录
概要
¥Synopsis
npm install-test [<package-spec> ...]alias: it
描述
¥Description
此命令运行一个 npm install
,后跟一个 npm test
。它采用与 npm install
完全相同的参数。
¥This command runs an npm install
followed immediately by an npm test
. It takes exactly the same arguments as npm install
.
配置
¥Configuration
save
-
默认值:
true
除非在使用npm update
时默认为false
¥Default:
true
unless when usingnpm update
where it defaults tofalse
-
类型:布尔值
¥Type: Boolean
将已安装的包作为依赖保存到 package.json
文件中。
¥Save installed packages to a package.json
file as dependencies.
与 npm rm
命令一起使用时,从 package.json
中删除依赖。
¥When used with the npm rm
command, removes the dependency from package.json
.
如果设置为 false
,也会阻止写入 package-lock.json
。
¥Will also prevent writing to package-lock.json
if set to false
.
save-exact
-
默认值:false
¥Default: false
-
类型:布尔值
¥Type: Boolean
保存到 package.json 的依赖将使用精确的版本进行配置,而不是使用 npm 的默认 semver 范围运算符。
¥Dependencies saved to package.json will be configured with an exact version rather than using npm's default semver range operator.
global
-
默认值:false
¥Default: false
-
类型:布尔值
¥Type: Boolean
在 "global" 模式下运行,以便将包安装到 prefix
文件夹而不是当前工作目录。有关行为差异的更多信息,请参见 文件夹。
¥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
文件夹,而不是当前工作目录。¥packages are installed into the
{prefix}/lib/node_modules
folder, instead of the current working directory. -
bin 文件链接到
{prefix}/bin
¥bin files are linked to
{prefix}/bin
-
手册页链接到
{prefix}/share/man
¥man pages are linked to
{prefix}/share/man
install-strategy
-
默认值:"hoisted"
¥Default: "hoisted"
-
类型:"hoisted"、"nested"、"shallow" 或 "linked"
¥Type: "hoisted", "nested", "shallow", or "linked"
设置在 node_modules 中安装包的策略。提升(默认):在顶层安装非复制,并在目录结构中根据需要复制。nested:(以前的 --legacy-bundling)就地安装,无需提升。浅层(以前的 --global-style)只在顶层安装直接的 deps。linked:(实验)安装在 node_modules/.store 中,链接到位,未提升。
¥Sets the strategy for installing packages in node_modules. hoisted (default): Install non-duplicated in top-level, and duplicated as necessary within directory structure. nested: (formerly --legacy-bundling) install in place, no hoisting. shallow (formerly --global-style) only install direct deps at top-level. linked: (experimental) install in node_modules/.store, link in place, unhoisted.
legacy-bundling
-
默认值:false
¥Default: false
-
类型:布尔值
¥Type: Boolean
-
DEPRECATED:此选项已被
--install-strategy=nested
弃用¥DEPRECATED: This option has been deprecated in favor of
--install-strategy=nested
不要在 node_modules
中提升包安装,而是以与它们所依赖的方式相同的方式安装包。这可能会导致非常深的目录结构和重复的软件包安装,因为没有数据去重。设置 --install-strategy=nested
。
¥Instead of hoisting package installs in node_modules
, install packages in the same manner that they are depended on. This may cause very deep directory structures and duplicate package installs as there is no de-duplicating. Sets --install-strategy=nested
.
global-style
-
默认值:false
¥Default: false
-
类型:布尔值
¥Type: Boolean
-
DEPRECATED:此选项已被
--install-strategy=shallow
弃用¥DEPRECATED: This option has been deprecated in favor of
--install-strategy=shallow
仅在顶层 node_modules
中安装直接依赖,但提升更深层次的依赖。设置 --install-strategy=shallow
。
¥Only install direct dependencies in the top level node_modules
, but hoist on deeper dependencies. Sets --install-strategy=shallow
.
omit
-
默认值:'dev' 如 果
NODE_ENV
环境变量设置为 'production',否则为空。¥Default: 'dev' if the
NODE_ENV
environment variable is set to 'production', otherwise empty. -
类型:"dev"、"optional"、"peer"(可多次设置)
¥Type: "dev", "optional", or "peer" (can be set multiple times)
要从磁盘上的安装树中省略的依赖类型。
¥Dependency types to omit from the installation tree on disk.
请注意,这些依赖仍会被解析并添加到 package-lock.json
或 npm-shrinkwrap.json
文件中。它们只是没有物理安装在磁盘上。
¥Note that these dependencies are still resolved and added to the package-lock.json
or npm-shrinkwrap.json
file. They are just not physically installed on disk.
如果一个包类型同时出现在 --include
和 --omit
列表中,那么它将被包括在内。
¥If a package type appears in both the --include
and --omit
lists, then it will be included.
如果生成的省略列表包含 'dev'
,则 NODE_ENV
环境变量将针对所有生命周期脚本设置为 'production'
。
¥If the resulting omit list includes 'dev'
, then the NODE_ENV
environment variable will be set to 'production'
for all lifecycle scripts.
strict-peer-deps
-
默认值:false
¥Default: false
-
类型:布尔值
¥Type: Boolean
如果设置为 true
,而 --legacy-peer-deps
没有设置,那么任何冲突的 peerDependencies
都将被视为安装失败,即使 npm 可以根据非对等依赖合理地猜测出适当的解决方案。
¥If set to true
, and --legacy-peer-deps
is not set, then any conflicting peerDependencies
will be treated as an install failure, even if npm could reasonably guess the appropriate resolution based on non-peer dependency relationships.
默认情况下,依赖图中的冲突 peerDependencies
将使用最近的非对等依赖规范来解决,即使这样做会导致某些包收到超出其包的 peerDependencies
对象中设置的范围的对等依赖。
¥By default, conflicting peerDependencies
deep in the dependency graph will be resolved using the nearest non-peer dependency specification, even if doing so will result in some packages receiving a peer dependency outside the range set in their package's peerDependencies
object.
当执行这样的覆盖时,会打印一条警告,解释冲突和涉及的包。如果设置了 --strict-peer-deps
,则此警告被视为失败。
¥When such an override is performed, a warning is printed, explaining the conflict and the packages involved. If --strict-peer-deps
is set, then this warning is treated as a failure.
prefer-dedupe
-
默认值:false
¥Default: false
-
类型:布尔值
¥Type: Boolean
如果可能,最好对包进行数据去重,而不是选择更新版本的依赖。
¥Prefer to deduplicate packages if possible, rather than choosing a newer version of a dependency.
package-lock
-
默认值:true
¥Default: true
-
类型:布尔值
¥Type: Boolean
如果设置为 false,则安装时忽略 package-lock.json
文件。如果 save
为真,这也将阻止写入 package-lock.json
。
¥If set to false, then ignore package-lock.json
files when installing. This will also prevent writing package-lock.json
if save
is true.
package-lock-only
-
默认值 :false
¥Default: false
-
类型:布尔值
¥Type: Boolean
如果设置为 true,当前操作将只使用 package-lock.json
,忽略 node_modules
。
¥If set to true, the current operation will only use the package-lock.json
, ignoring node_modules
.
对于 update
,这意味着只会更新 package-lock.json
,而不是检查 node_modules
并下载依赖。
¥For update
this means only the package-lock.json
will be updated, instead of checking node_modules
and downloading dependencies.
对于 list
,这意味着输出将基于 package-lock.json
描述的树,而不是 node_modules
的内容。
¥For list
this means the output will be based on the tree described by the package-lock.json
, rather than the contents of node_modules
.
foreground-scripts
-
默认值:false
¥Default: false
-
类型:布尔值
¥Type: Boolean
在前台进程中运行已安装包的所有构建脚本(即 preinstall
、install
和 postinstall
)脚本,与主 npm 进程共享标准输入、输出和错误。
¥Run all build scripts (ie, preinstall
, install
, and postinstall
) scripts for installed packages in the foreground process, sharing standard input, output, and error with the main npm process.
请注意,这通常会使安装运行速度变慢,并且噪音更大,但对调试很有用。
¥Note that this will generally make installs run slower, and be much noisier, but can be useful for debugging.
ignore-scripts
-
默认值:false
¥Default: false
-
类型:布尔值
¥Type: Boolean
如果为 true,npm 不会运行 package.json 文件中指定的脚本。
¥If true, npm does not run scripts specified in package.json files.
请注意,如果设置了 ignore-scripts
,则明确旨在运行特定脚本的命令(例如 npm start
、npm stop
、npm restart
、npm test
和 npm run-script
)仍将运行其预期的脚本,但它们不会运行任何前置或后置脚本。
¥Note that commands explicitly intended to run a particular script, such as npm start
, npm stop
, npm restart
, npm test
, and npm run-script
will still run their intended script if ignore-scripts
is set, but they will not run any pre- or post-scripts.
audit
-
默认值:true
¥Default: true
-
类型:布尔值
¥Type: Boolean
当 "true" 将审计报告与当前 npm 命令一起提交到默认注册表和为范围配置的所有注册表时。有关提交内容的详细信息,请参阅 npm audit
的文档。
¥When "true" submit audit reports alongside the current npm command to the default registry and all registries configured for scopes. See the documentation for npm audit
for details on what is submitted.
bin-links
-
默认值:true
¥Default: true
-
类型:布尔值
¥Type: Boolean
告诉 npm 为包的可执行文件创建符号链接(或 Windows 上的 .cmd
垫片)。
¥Tells npm to create symlinks (or .cmd
shims on Windows) for package executables.
设置为 false 使其不执行此操作。这可以用来解决某些文件系统不支持符号链接的事实,即使在表面上是 Unix 系统上也是如此。
¥Set to false to have it not do this. This can be used to work around the fact that some file systems don't support symlinks, even on ostensibly Unix systems.
fund
-
默认值:true
¥Default: true
-
类型:布尔值
¥Type: Boolean
当 "true" 在每个 npm install
的末尾显示消息时,确认正在寻找资金的依赖的数量。详见 npm fund
。
¥When "true" displays the message at the end of each npm install
acknowledging the number of dependencies looking for funding. See npm fund
for details.
dry-run
-
默认值:false
¥Default: false
-
类型:布尔值
¥Type: Boolean
表示你不希望 npm 进行任何更改,并且它应该只报告它会做的事情。这可以传递到任何修改本地安装的命令中,例如 install
、update
、dedupe
、uninstall
以及 pack
和 publish
。
¥Indicates that you don't want npm to make any changes and that it should only report what it would have done. This can be passed into any of the commands that modify your local installation, eg, install
, update
, dedupe
, uninstall
, as well as pack
and publish
.
注意:其他网络相关命令不支持此功能,例如 dist-tags
、owner
等。
¥Note: This is NOT honored by other network related commands, eg dist-tags
, owner
, etc.
cpu
-
默认值:null
¥Default: null
-
类型:空值或字符串
¥Type: null or String
覆盖要安装的原生模块的 CPU 架构。可接受的值与 package.json 的 cpu
字段相同,该字段来自 process.arch
。
¥Override CPU architecture of native modules to install. Acceptable values are same as cpu
field of package.json, which comes from process.arch
.
os
-
默认值:null
¥Default: null
-
类型:空值或字符串
¥Type: null or String
覆盖要安装的原生模块的操作系统。可接受的值与 package.json 的 os
字段相同,该字段来自 process.platform
。