在atom+react-native项目中安装了nuclide。然而使用flow的时候出现了问题。

$ brew -v
Homebrew 1.2.0

$ flow version
Flow, a static type checker for JavaScript, version 0.45.0

$ flow
Launching Flow server for /Users/real/Desktop/reactPro/pro2
Wrong version of Flow. The config specifies version ^0.42.0 but this is version 0.45.0

在我的.flowconfig文件中最后的地方也可以看到:

[version]
^0.42.0

这意味着flow的版本应该是>=0.42.0 <0.43.0,所以0.45.0是不合适的。这就需要下载0.42.0的版本。

搜索了网上一些说法(brew 安装特定版本):

brew install flow(安装的是最新版本)

brew versions (已经废弃了)

brew tap homebrew/versions(已经废弃了)

Warning: homebrew/versions was deprecated. This tap is now empty as all its formulae were migrated.

npm install flow-bin@0.42.0 -g (可以安装,但是没看到实际效果)

在我安装flow的过程中有这样的提示:

$ brew install flow
==> Downloading https://homebrew.bintray.com/bottles/flow-0.45.0.sierra.bottle.tar.gz
Already downloaded: /Users/real/Library/Caches/Homebrew/flow-0.45.0.sierra.bottle.tar.gz
==> Pouring flow-0.45.0.sierra.bottle.tar.gz
==> Caveats
Bash completion has been installed to:
 /usr/local/etc/bash_completion.d

zsh completions have been installed to:
 /usr/local/share/zsh/site-functions
==> Summary
"htmlcode">
https://homebrew.bintray.com/bottles/flow-0.42.0.sierra.bottle.tar.gz

然后将解压后的文件放到

/usr/local/Cellar/flow/

这样就安装了0.42.0的版本。然后通过

$ brew switch flow 0.42.0

就可以了。。一番心酸。。老哥们赞一赞。。

以上这篇快速解决brew安装特定版本flow的问题就是小编分享给大家的全部内容了,希望能给大家一个参考,也希望大家多多支持。

广告合作:本站广告合作请联系QQ:858582 申请时备注:广告合作(否则不回)
免责声明:本站资源来自互联网收集,仅供用于学习和交流,请遵循相关法律法规,本站一切资源不代表本站立场,如有侵权、后门、不妥请联系本站删除!