1:? 一定要安裝?choco
用管理員身份運(yùn)行 cmd | Powershell@powershell -NoProfile -ExecutionPolicy unrestricted -Command "iex ((new-object net.webclient).DownloadString('https://chocolatey.org/install.ps1'))" && SET PATH=%PATH%;%ALLUSERSPROFILE%\chocolatey\bin
否則不好全局管理FVM,全部輸入Y
2:?
choco install fvm
3:??fvm config --cache-path D:\fvm\
4: 在用戶環(huán)境變量中添加 FVM_HOME,設(shè)置為?D:\fvm\
5: fvm install 3.7.7
6:?fvm global 3.7.7
7: 在path里添加??D:\fvm\default\bin? 和??D:\fvm\default\bin\cache\dart-sdk\bin
8: path里刪除安裝choco時(shí)添加的 C:\tools\dart-sdk\bin
9: vscode里setting里搜索flutterSdkPaths? ?輸入 D:/fvm/? 就可以在vscode里change sdk了
10:完成 !
https://fvm.app/docs/guides/faq/#environment-variables-order-for-windows-in-path
-------------------------------------------------------------------------------------------------------------------
Invalid kernel binary or invalid sdk hash when running FVM?
There are a few reasons this can happen. However it means that the FVM snapshot is not compatible with the Dart version that is installed.
Please do the following:
- On Windows make sure your env variables are in the following order as described?here.
- Run?
dart pub global deactivate fvm
- Run?
dart pub global activate fvm
-------------------------------------------------------------------------------------------------------------------
Environment variables order for Windows in PATH?
Flutter comes with Dart embedded. Because of that you can find some conflicts when running standalone Dart and Flutter together. Here is a suggestion of what we found to be the correct order of dependencies to avoid issues.文章來(lái)源:http://www.zghlxwxcb.cn/news/detail-697558.html
- Pub Cache for global packages
- Dart SDK (if installed outside of Flutter)
- Flutter SDK
It should look like this.文章來(lái)源地址http://www.zghlxwxcb.cn/news/detail-697558.html
C:\Users\<user>\AppData\Roaming\Pub\Cache\bin
C:\src\flutter\bin\cache\dart-sdk\bin
C:\src\flutter\bin
到了這里,關(guān)于flutter環(huán)境之安裝FVM的文章就介紹完了。如果您還想了解更多內(nèi)容,請(qǐng)?jiān)谟疑辖撬阉鱐OY模板網(wǎng)以前的文章或繼續(xù)瀏覽下面的相關(guān)文章,希望大家以后多多支持TOY模板網(wǎng)!