英文:
How can i solve this pub deprecated pub
问题
以下是翻译好的内容:
pub get 失败
命令: "C:\src\flutter\bin\cache\dart-sdk\bin\dart __deprecated_pub --directory . get --example"
pub 环境: {
"FLUTTER_ROOT": "C:\src\flutter",
"PUB_ENVIRONMENT": "vscode.dart-code:flutter_cli:get",
"PUB_CACHE": "C:\Users\BOSS-PRYME\AppData\Local\Pub\Cache",
}
请注意,我已经删除了图像链接,只保留了文本内容。如果您需要更多帮助,请随时提出。
英文:
pub get failed
command: "C:\src\flutter\bin\cache\dart-sdk\bin\dart __deprecated_pub --directory . get --example"
pub env: {enter image description here
"FLUTTER_ROOT": "C:\src\flutter",
"PUB_ENVIRONMENT": "vscode.dart-code:flutter_cli:get",
"PUB_CACHE": "C:\Uenter image description heresers\BOSS-PRYME\AppData\Local\Pub\Cache",
}
答案1
得分: 0
在Linux上,这对我和许多其他人都有效...
它也应该对你有效。
export PUB_HOSTED_URL=https://pub.flutter-io.cn
export FLUTTER_STORAGE_BASE_URL=https://storage.flutter-io.cn
在Windows上,你应该创建一个环境变量:
-
名称:PUB_HOSTED_URL
-
值:https://pub.flutter-io.cn
-
名称:FLUTTER_STORAGE_BASE_URL
-
值:https://storage.flutter-io.cn
这段代码来源于MathiasGodwin在Grepper上的回答。
此答案来自https://stackoverflow.com/questions/64588402/flutter-pub-get-takes-too-long-to-execute#:~:text=Step%201%3A%20flutter%20clean%20step,dependencies%20and%20slow%20internet%20connection.&text=Save%20this%20answer.,-Show%20activity%20on
英文:
On Linux, this worked for me and for many other people...
It should work for you too.
export PUB_HOSTED_URL=https://pub.flutter-io.cn export FLUTTER_STORAGE_BASE_URL=https://storage.flutter-io.cn
On windows, you should create an environment variable with:
name: PUB_HOSTED_URL value: https://pub.flutter-io.cn
name: FLUTTER_STORAGE_BASE_URL value: https://storage.flutter-io.cn
#Code gotten from MathiasGodwin on Grepper
答案2
得分: 0
对于我来说,我遇到这个错误是因为我的Dart版本低于我的项目要求在pubspec.yaml中,我将我的项目版本更改为与我的Dart SDK相匹配。
英文:
For me, I was facing this error because my dart version was lower than my project requirement in pubspec.yaml, I changed my project version to match that of my dart sdk
通过集体智慧和协作来改善编程学习和解决问题的方式。致力于成为全球开发者共同参与的知识库,让每个人都能够通过互相帮助和分享经验来进步。
评论