user8526894
user8526894

Reputation:

Visual studio code error :-Failed to start flow Error: Wrong version of Flow. The config specifies version ^0.92.0 but this is version 0.95.1

Hello I am a beginner in React-native and below is my flowconfig file's version and I get an error with this version

[version]
^0.92.0

Is there a way to fix this error, I was trying to run debug mode in visual code for running react-native projects and to print console.log. So far I am unsuccessful.

PS:- beginner in react-native

Upvotes: 15

Views: 19758

Answers (3)

KyleMit
KyleMit

Reputation: 30137

1. Check that the following tags match

package.json

"devDependencies": {
  "flow-bin": "0.130.0"
}

.flowconfig

[version]
^0.130.0

2. Clean & Reinstall

If they match, this error can occur when your node_modules are out of sync with the version of flow-bin in your package.json. This can occur if you've changed branches recently or have have an older version in your node modules.

Try removing and reinstalling like this:

rm -rf node_modules/ && npm i

Upvotes: 8

tonsteri
tonsteri

Reputation: 845

Change [version] in the .flowconfig to match the installed version, ^0.95.1

screenshot example

Upvotes: 28

Taher Alkhateeb
Taher Alkhateeb

Reputation: 41

Instead of changing the flow version make it a ranged version. For example something like >=0.50.0 or simply remove the version altogether. You can read about that more in the flowconfig docs

I find that changing the flow version every time you face this problem to be a bad approach especially if you work with a team and each team member has a different version installed and they would commit their version into the .flowconfig file

Upvotes: 2

Related Questions