首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >渡槽:如何解决不良状态:无元素错误

渡槽:如何解决不良状态:无元素错误
EN

Stack Overflow用户
提问于 2020-06-26 19:51:03
回答 1查看 689关注 0票数 0

Getting Started with Aqueduct上按照步骤创建渡槽的新项目时,我在创建新项目时遇到错误

错误:

代码语言:javascript
复制
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的版本为:

代码语言:javascript
复制
Dart VM version: 2.8.4 (stable) (Wed Jun 3 12:26:04 2020 +0200) on "windows_x64"
EN

回答 1

Stack Overflow用户

发布于 2020-06-26 20:25:48

我很确定你还没做过pub global activate aqueduct

stackTrace指向342行

代码语言:javascript
复制
   341 .getGlobalApplications()
   342 .firstWhere((app) => app.name == "aqueduct")

当Iterable中没有元素时,firstWhere()抛出StateError("No element")

票数 -2
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/62594134

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档