.flowconfig [version]
你可以在 .flowconfig
中指定你希望使用哪个版本的 Flow。你可以使用 [version]
部分执行此操作。如果省略此部分或留空,则允许任何版本。如果指定版本但不匹配,则 Flow 将立即出错并退出。
¥You can specify in the .flowconfig
which version of Flow you expect to use.
You do this with the [version]
section. If this section is omitted or left
blank, then any version is allowed. If a version is specified and not matched,
then Flow will immediately error and exit.
因此,如果你的 .flowconfig
中有以下内容:
¥So if you have the following in your .flowconfig
:
[version]
0.22.0
并且你尝试使用 Flow v0.21.0,则 Flow 将立即出现错误并显示以下消息
¥and you try to use Flow v0.21.0, then Flow will immediately error with the message
"Wrong version of Flow. The config specifies version 0.22.0 but this is version 0.21.0"
到目前为止,我们支持以下方式指定支持的版本
¥So far, we support the following ways to specify supported versions
显式版本(例如
0.22.0
,仅匹配0.22.0
)。¥Explicit versions, (e.g.
0.22.0
, which only matches0.22.0
).交集范围,通过 AND 组合在一起(例如
>=0.13.0 <0.14.0
,匹配0.13.0
和0.13.5
,但不匹配0.14.0
)。¥Intersection ranges, which are ANDed together, (e.g.
>=0.13.0 <0.14.0
, which matches0.13.0
and0.13.5
but not0.14.0
).插入符范围,允许进行不修改最左侧非零数字的更改(例如
^0.13.0
扩展为>=0.13.0 <0.14.0
,^0.13.1
扩展为>=0.13.1 <0.14.0
,而^1.2.3
扩展为>=1.2.3 <2.0.0
)。¥Caret ranges, which allow changes that do not modify the left-most non-zero digit (e.g.
^0.13.0
expands into>=0.13.0 <0.14.0
, and^0.13.1
expands into>=0.13.1 <0.14.0
, whereas^1.2.3
expands into>=1.2.3 <2.0.0
).