简体   繁体   中英

Just cloned the flutter repo, is it installing the correct dart sdk?

I just cloned the flutter repo in my home directory and added $HOME/flutter/bin to my PATH .

When I run flutter --help I get the following error:

$ flutter --help
Building flutter tool...
/home/noib3/flutter/bin/internal/shared.sh: line 24: /home/noib3/flutter/bin/cache/dart-sdk/bin/dart: No such file or directory
Error: Unable to 'pub upgrade' flutter tool. Retrying in five seconds... (9 tries left)
^C

The reported error is that ~/flutter/bin/cache/dart-sdk/bin/dart doesn't exist, which isn't true, the dart sdk is there.

I then tried to execute the line 24 in ~/flutter/bin/internal/shared.sh manually:

$ ~/flutter/bin/cache/dart-sdk/bin/dart __deprecated_pub upgrade --verbosity=normal --no-precompile
Failed to execute process '/home/noib3/flutter/bin/cache/dart-sdk/bin/dart'. Reason:
The file '/home/noib3/flutter/bin/cache/dart-sdk/bin/dart' does not exist or could not be executed.

Having ruled out the does not exist option, I'm left with could not be executed . I'm not sure what's going wrong here. Is it installing the right dark sdk for my OS? I'm using Linux, specifically NixOS.

Any help?

Go inside the flutter/bin folder and delete the cache folder.

If that doesn't work, I recommend deleting it and downloading it again. Maybe restarting your computer after adding it to path.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM