我正在尝试生成我的颤振应用程序的文档,而dartdoc命令并没有像预期的那样工作。
我试过:
flutter pub global deactivate dartdoc
flutter pub global activate dartdoc 产出如下:
Resolving dependencies...
+ _fe_analyzer_shared 31.0.0
+ analyzer 2.8.0
+ args 2.3.0
+ async 2.8.2
+ charcode 1.3.1
+ cli_util 0.3.5
+ collection 1.15.0
+ convert 3.0.1
+ crypto 3.0.1
+ csslib 0.17.1
+ dartdoc 4.1.0
+ file 6.1.2
+ glob 2.0.2
+ html 0.15.0
+ logging 1.0.2
+ markdown 4.0.1
+ meta 1.7.0
+ package_config 2.0.2
+ path 1.8.0
+ pub_semver 2.1.0
+ source_span 1.8.1
+ string_scanner 1.1.0
+ term_glyph 1.2.0
+ typed_data 1.3.0
+ watcher 1.0.1
+ yaml 3.1.0
Installed executable dartdoc.
Warning: Executable "dartdoc" runs "bin/dartdoc.dart", which was not found in dartdoc.
Warning: Pub installs executables into $HOME/Desktop/flutter/.pub-cache/bin, which is not on your path.
You can fix that by adding this to your shell's config file (.bashrc, .bash_profile, etc.):
export PATH="$PATH":"$HOME/Desktop/flutter/.pub-cache/bin"
Activated dartdoc 4.1.0.我还在我的PATH中增加了出口建议。
现在,当我在我的分支程序根目录中运行dartdoc命令时,下面是输出:
No active package dartdoc.我也尝试过做一个flutter pub cache repair,但没有帮助。
我还能做些什么才能让它起作用?
Note:在我升级到flutter 2.8之前,它是工作的
发布于 2021-12-13 15:16:37
我也经历过这个问题。在我的例子中,我设法解决了它的运行:
dart pub global activate dartdoc而不是:
flutter pub global activate dartdochttps://stackoverflow.com/questions/70318598
复制相似问题