无法为 web 设置 flutter
Unable to setup flutter for web
当我尝试执行命令时:flutter channel beta
我收到以下错误:
Switching to flutter channel 'beta'...
git: fatal: unable to access 'https://github.com/flutter/flutter.git/': error setting certificate verify
locations: CAfile: C:\Program Files\Git\mingw64\ssl\certs\ca-bundle.cert CApath: none
Switching channels failed with error code 128.
其中一个 SO 解决方案建议我使用命令:git config --system http.sslcainfo 'C:\Program Files\Git\mingw64\ssl\certs\ca-bundle.crt'
,但这并没有改变错误。我该如何解决这个问题?
我发现问题不在于 flutter,而在于 git。 Flutter 使用 git 作为其命令,但 git 无法找到证书文件。对我有用的是:
- 访问https://github.com/flutter/flutter.git/
- 从地址栏查看证书并保存(假设为 poc.cer)
- 使用以下命令将此证书添加到 git 配置:git config --global http.sslCAInfo "C:\Users\Username\Desktop\poc.cer"
现在命令可以正常工作了
当我尝试执行命令时:flutter channel beta
我收到以下错误:
Switching to flutter channel 'beta'...
git: fatal: unable to access 'https://github.com/flutter/flutter.git/': error setting certificate verify
locations: CAfile: C:\Program Files\Git\mingw64\ssl\certs\ca-bundle.cert CApath: none
Switching channels failed with error code 128.
其中一个 SO 解决方案建议我使用命令:git config --system http.sslcainfo 'C:\Program Files\Git\mingw64\ssl\certs\ca-bundle.crt'
,但这并没有改变错误。我该如何解决这个问题?
我发现问题不在于 flutter,而在于 git。 Flutter 使用 git 作为其命令,但 git 无法找到证书文件。对我有用的是:
- 访问https://github.com/flutter/flutter.git/
- 从地址栏查看证书并保存(假设为 poc.cer)
- 使用以下命令将此证书添加到 git 配置:git config --global http.sslCAInfo "C:\Users\Username\Desktop\poc.cer"
现在命令可以正常工作了