目前,我安装了飞镖与颤振,版本如下:
Flutter 1.23.0-18.1.pre • channel beta • https://github.com/flutter/flutter.git
Framework • revision 198df796aa (2 weeks ago) • 2020-10-15 12:04:33 -0700
Engine • revision 1d12d82d9c
Tools • Dart 2.11.0 (build 2.11.0-213.1.beta)我主要是使用Mobile前端开发,因此这个设置对我有好处。
但是对于后端数据库开发,我开始学习渡槽(已开始/)。我注意到渡槽3.3.0+1 (这是目前稳定的渡槽版本)只能在dart <2.8.0的情况下工作。
因此,我想知道我是否可以在我的mac中安装两个版本的飞镖。如果是的话,我怎么能做到呢?和如何切换或选择不同版本的飞镖,以颤振和水艺术,当我分别或在同一时间(如果可能的话)?
编辑:我这么做是因为我在运行aqueduct create project时出错了。有解决办法吗?
-- Aqueduct CLI Version: 3.3.0+1
*** Uncaught error
Bad state: No element
**** Stacktrace
* #0 ListMixin.firstWhere (dart:collection/list.dart:150:5)
* #1 CLIAqueductGlobal.aqueductPackageRef (package:aqueduct/src/cli/commands/create.dart:342:10)
* #2 CLIAqueductGlobal.templateDirectory (package:aqueduct/src/cli/commands/create.dart:347:12)
* #3 CLIAqueductGlobal.getTemplateLocation (package:aqueduct/src/cli/commands/create.dart:351:12)
* #4 CLITemplateCreator.handle (package:aqueduct/src/cli/commands/create.dart:51:27)
* #5 CLICommand.process (package:aqueduct/src/cli/command.dart:159:20)
* <asynchronous suspension>
* #6 CLICommand.process (package:aqueduct/src/cli/command.dart:135:12)
* #7 main (file:///C:/Users/dos/AppData/Local/Pub/Cache/hosted/pub.dartlang.org/aqueduct-3.3.0+1/bin/aqueduct.dart:9:27)
* #8 _startIsolate.<anonymous closure> (dart:isolate-patch/isolate_patch.dart:299:32)
* #9 _RawReceivePortImpl._handleMessage (dart:isolate-patch/isolate_patch.dart:168:12)
****发布于 2020-10-29 23:33:57
当我运行aqueduct create project时,我在编辑中遇到的问题是没有正确地设置pub。
如果您正面临这个问题,请使用
pub。pub global activate aqueduct,而不是flutter pub global activate aqueduct,然后创建项目,而不会出现任何问题。发布于 2020-10-29 20:47:18
这不是真的。在pubsbpec.yaml中,渡槽和颤振手柄的Dart版本低于3.0.0
我和我的兄弟正在进行一个开发项目,我正在使用这个最新的工作导水管。
Flutter (Channel master, 1.24.0-4.0.pre.138, on Mac OS X 10.15.7 19H2
darwin-x64, locale en-BR)您不需要担心flutter的dart sdk,它单独处理它
要使用与颤振分离的新版本的飞镖,只需使用家用啤酒。
brew tap dart-lang/dart
brew install dart在您的颤振项目中,您可以使用新的省道路径在settings.json内部的.vscode文件夹中重写(我使用的是flutter_master构建,所以我也不得不重写它而不是颤振稳定)
{
"dart.flutterSdkPath": "~/Library/flutter_master/bin",
"dart.sdkPath": "/usr/local/bin/dart"
}更新1:
使用以下内容更新pubspec.yaml
dependencies:
aqueduct: 3.3.0+1
dependency_overrides:
postgres: 2.2.0你提到的错误也发生在我身上,我忘了提。我很久以前在这个github线程上发现的问题
https://stackoverflow.com/questions/64598867
复制相似问题