我爱模板网 > 建站教程 > APP开发,混合APP >  The term 'Unblock-File' is not recognized as the name of a c正文

The term 'Unblock-File' is not recognized as the name of a c

运行flutter doctor和 flutter upgrade,出现下面的提示:
The term 'Unblock-File' is not recognized as the name of a cmdlet, function, script file, or operable program. Check the spelling of the name, or if a path was included, verify that the path is correct and try again.
或者:
flutter doctor 无法将"unblock-file" 项识别为 cmdlet,函数,脚本文件或可运行程

在此之前已经确认了PowerShell是已经安装了的,有些系统是自带安装的,有些可能没有,没有的同学重新安装可能不会出现这个问题。
我的是已经有安装了的网上云雨一番之后,我就去检查了下PowerShell的版本,我们找到已经安装好的PowerShell,打开执行命令
$PSVersionTable.PSVersion

起初的版本是2.0,所以我又去官网下了一个区安装
https://www.microsoft.com/en-us/download/confirmation.aspx?id=54616
这个是5.0的,安装完成后一定要重启才能生效。

这次更新完成之后再去执行flutter doctor 就不会报错了。

原因 :更新dart sdk的脚本使用的是基于powershell 5.0的语法 win7默认powershell 版本不支持。
解决方案:安装powershell最新版本。


部分素材资源来源网站,本站提供免费下载,如有侵权请联系站长马上删除!
上一篇:Flutter 拆分小部件用class类还是方法 下一篇:Please migrate your app to AndroidX
发表评论
请自觉遵守互联网相关的政策法规,严禁发布色情、暴力、反动的言论。
选择头像:
最新评论

猜你喜欢