我曾尝试寻找解决方案或解决此问题的方法,但没有成功。
以下是描述我的流程安装以及最终我面临的问题的一些步骤。
Step 1:我使用创建了一个新的反应本机项目react-native init TestProject
.
我想配置flow http://flow.org对于我的项目,但没有.flowconfig文件。
据我们所知,流量版需要指定在本地为项目安装流程,使用以下脚本:yarn add --dev [email protected] /cdn-cgi/l/email-protection babel-preset-flow
.
Step 2:即使我没有 .flowconfig 文件,因此没有要安装哪个特定版本的流的信息,我尝试使用以下命令为我的项目安装流:
yarn add --dev flow-bin babel-preset-flow
.这已经安装了最新的流程0.79.1.
Step 3:要生成 .flowconfig 文件,使用以下脚本:./node_modules/.bin/flow init
。这创造了.flowconfig项目目录中的文件,其中包含一些默认条目,如下所示:
Step 4: I restarted the VSCode to start flow server:![enter image description here](https://i.stack.imgur.com/bOzkS.png)
As the flow server was running, here I found out the there are 98 problems with the react-native library:![image](https://i.stack.imgur.com/jUygP.png)
Step 5 : I added ./node_modules/. under [ignore] in .flowconfig file and restarted VSCode again.![image](https://i.stack.imgur.com/g5tEe.png)
Step 6 : Now the error caught by flow is, it cannot find the module react-native:![image](https://i.stack.imgur.com/xueDX.png)
Here is the project's package.json:
Here is the React Native Environment Info:
![image](https://i.stack.imgur.com/pPMd6.png)
请建议是否有人解决了这个问题。
提前致谢。