简体   繁体   English

刚刚克隆了 flutter 存储库,它是否安装了正确的 dart sdk?

[英]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 .我刚刚在我的主目录中克隆了 flutter 存储库,并将$HOME/flutter/bin添加到我的PATH中。

When I run flutter --help I get the following error:当我运行flutter --help时,我收到以下错误:

$ 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.报告的错误是~/flutter/bin/cache/dart-sdk/bin/dart不存在,这是不正确的,dart sdk 在那里。

I then tried to execute the line 24 in ~/flutter/bin/internal/shared.sh manually:然后我尝试手动执行~/flutter/bin/internal/shared.sh中的第 24 行:

$ ~/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 .排除了does not exist选项后,我留下了could not be executed I'm not sure what's going wrong here.我不确定这里出了什么问题。 Is it installing the right dark sdk for my OS?是否为我的操作系统安装了正确的深色 sdk? I'm using Linux, specifically NixOS.我正在使用 Linux,特别是 NixOS。

Any help?有什么帮助吗?

Go inside the flutter/bin folder and delete the cache folder. Go 在flutter/bin文件夹中并删除缓存文件夹。

If that doesn't work, I recommend deleting it and downloading it again.如果这不起作用,我建议将其删除并重新下载。 Maybe restarting your computer after adding it to path.也许在将其添加到路径后重新启动计算机。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

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