npm-install-ci-test
选择命令行版本:
See Details
目录
概要
¥Synopsis
npm install-ci-testaliases: cit, clean-install-test, sit
描述
¥Description
此命令运行 npm ci
,然后立即运行 npm test
。
¥This command runs npm ci
followed immediately by npm test
.
配置
¥Configuration
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.
include
-
默认值:
¥Default:
-
类型:"prod"、"dev"、"optional"、"peer"(可多次设置)
¥Type: "prod", "dev", "optional", or "peer" (can be set multiple times)
允许定义要安装的依赖类型的选项。
¥Option that allows for defining which types of dependencies to install.
这是 --omit=<type>
的倒数。
¥This is the inverse of --omit=<type>
.
--include
中指定的依赖类型将不会被忽略,无论命令行中指定省略/包含的顺序如何。
¥Dependency types specified in --include
will not be omitted, regardless of the order in which omit/include are specified on the command-line.
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.