在Getting Started with Aqueduct上按照步骤创建渡槽的新项目时,我在创建新项目时遇到错误
错误:
C:\Users\khalifa>aqueduct create store1
-- 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/khalifa/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)
****dart的版本为:
Dart VM version: 2.8.4 (stable) (Wed Jun 3 12:26:04 2020 +0200) on "windows_x64"发布于 2020-06-26 20:25:48
我很确定你还没做过pub global activate aqueduct
stackTrace指向342行
341 .getGlobalApplications()
342 .firstWhere((app) => app.name == "aqueduct")当Iterable中没有元素时,firstWhere()抛出StateError("No element")
https://stackoverflow.com/questions/62594134
复制相似问题