webdev为flutter_web helloworld示例提供命令错误

时间:2019-06-09 02:40:48

标签: flutter dart flutter-web

我已经克隆了https://github.com/flutter/flutter_web存储库,并且正在尝试在示例目录中运行hello_world程序。

我已经完成了GitHub页面中指示的所有操作。 另外,我使用apt安装了dart SDK,因为我遇到了另一个错误“ webdev dart:未找到”,此问题已得到解决。

现在,在运行“ webdev serve”时出现以下错误, “自生成pubspec.lock文件以来,pubspec.yaml文件已更改,请再次运行“ pub get”。“

我运行了“ flutter pub get”和“ flutter pub upgrade”,但这没有解决。

我希望这可以在端口8080上启动Web服务器。

的输出
flutter pub get -v

[  +18 ms] executing: [/home/meth/Documents/development/flutter/] git log -n 1 --pretty=format:%H
[  +21 ms] Exit code 0 from: git log -n 1 --pretty=format:%H
[        ] 7a4c33425ddd78c54aba07d86f3f9a4a0051769b
[        ] executing: [/home/meth/Documents/development/flutter/] git describe --match v*.*.* --first-parent --long --tags
[   +7 ms] Exit code 0 from: git describe --match v*.*.* --first-parent --long --tags
[        ] v1.5.4-hotfix.2-0-g7a4c33425
[   +8 ms] executing: [/home/meth/Documents/development/flutter/] git rev-parse --abbrev-ref --symbolic @{u}
[   +5 ms] Exit code 0 from: git rev-parse --abbrev-ref --symbolic @{u}
[        ] origin/stable
[        ] executing: [/home/meth/Documents/development/flutter/] git ls-remote --get-url origin
[   +7 ms] Exit code 0 from: git ls-remote --get-url origin
[        ] https://github.com/flutter/flutter.git
[  +36 ms] executing: [/home/meth/Documents/development/flutter/] git rev-parse --abbrev-ref HEAD
[   +8 ms] Exit code 0 from: git rev-parse --abbrev-ref HEAD
[        ] stable
[  +21 ms] Artifact Instance of 'FlutterWebSdk' is not required, skipping update.
[   +3 ms] Artifact Instance of 'WindowsEngineArtifacts' is not required, skipping update.
[        ] Artifact Instance of 'MacOSEngineArtifacts' is not required, skipping update.
[        ] Artifact Instance of 'LinuxEngineArtifacts' is not required, skipping update.
[        ] Artifact Instance of 'FuchsiaCacheArtifacts' is not required, skipping update.
[  +16 ms] Running "flutter packages get" in hello_world...
[   +3 ms] Using /home/meth/Documents/development/flutter/.pub-cache for the pub cache.
[   +1 ms] executing: [/home/meth/Documents/work/flutter_web/examples/hello_world/] /home/meth/Documents/development/flutter/bin/cache/dart-sdk/bin/pub --verbosity=warning --verbose get
--no-precompile
[ +440 ms] ! flutter_web 0.0.0 from path ../../packages/flutter_web
[   +1 ms] ! flutter_web_ui 0.0.0 from path ../../packages/flutter_web_ui
[  +49 ms] Running "flutter packages get" in hello_world... (completed in 0.5s)
[ +166 ms] "flutter get" took 717ms.
[        ] "flutter get" took 717ms.

的输出
webdev serve -v

webdev could not run for this project.
The pubspec.yaml file has changed since the pubspec.lock file was generated, please run "pub get" again.

我当前的目录

drwxrwxr-x 3 meth meth  4096 Jun  9 07:38 android
drwxrwxr-x 4 meth meth  4096 Jun  9 07:38 ios
drwxrwxr-x 2 meth meth  4096 Jun  9 07:41 lib
-rw-rw-r-- 1 meth meth 10592 Jun  9 12:00 pubspec.lock
-rw-rw-r-- 1 meth meth   400 Jun  9 07:55 pubspec.yaml
drwxrwxr-x 2 meth meth  4096 Jun  9 07:40 web

1 个答案:

答案 0 :(得分:1)

有一个解决方案。在这里找到 https://github.com/flutter/flutter/issues/32313

使用

flutter packages pub global run webdev build

代替webdev build

flutter packages pub global run webdev serve

代替webdev serve