在windows中安裝dart,使用Chocolatey命令行進行安裝,
直接使用cmd打開命令行執行choco install dart-sdk報錯:
'choco' 不是內部或外部命令,也不是可運行的程序
或批處理文件。
原因是在windows環境中還沒有安裝Chocolatey
安裝Chocolatey必須使用windows 的powershell.exe進行安裝,windows打開powershell.exe的方法數 Win+x
打開powershell后執行以下,命令即可:
Set-ExecutionPolicy Bypass -Scope Process -Force; [System.Net.ServicePointManager]::SecurityProtocol = [System.Net.ServicePointManager]::SecurityProtocol -bor 3072; iex ((New-Object System.Net.WebClient).DownloadString('https://chocolatey.org/install.ps1'))
現在就可以按以下步驟安裝dart了:

