Error when reading 'migrate': No such file or directory

Viewed 956

I want to use migration tool as described here.

But I get Error: Error when reading 'migrate': No such file or directory

Here my dart version and error

xxx@xxx-:~/Desktop/xxx$ dart --version
Dart VM version: 2.4.0 (Unknown timestamp) on "linux_x64"
xxx@xxx-I:~/Desktop/xxx$ dart migrate

Error: Error when reading 'migrate': No such file or directory

pubspec.yaml

version: 1.0.0+1

environment:
  sdk: ">=2.12.0 <3.0.0"
1 Answers

**

First solution :**

dart --version

If the dart sdk version is less than 2.12.0

Then try:

Flutter upgrade --force 

or

   dart upgrade 

If dart migrate still doesn'tt work then jump to the second solution

Second solution :

since dart is already downloaded as part of flutter Make sure first that it hasn't been downloaded twice

on Mac try :

where dart

on MS windows , check your path in the environment variables.

If there was more than one path for the dart sdk , then this is problem

In my case I had it installed twice

/usr/local/bin/dart
/Users/USER/Documents/flutter/bin/dart

so I removed the first one by (mac os)

rm /usr/local/bin/dart

The moment I did that the issue was fixed.

Try

dart --version 

again and you should be having the latest version of dart that comes with flutter and you should be able to run succsfully

dart migrate 
Related