webdev обслужил ошибки команды для примера helloworld flutter_web - PullRequest
0 голосов
/ 09 июня 2019

Я клонировал репозиторий https://github.com/flutter/flutter_web и пытаюсь запустить программу hello_world в каталоге примеров.

Я выполнил все инструкции на странице GitHub.Кроме того, я установил dart SDK с помощью apt, поскольку получал еще одну ошибку «webdev dart: not found», это было исправлено.

Теперь при запуске «webdev serve» я получаю следующую ошибку »Файл pubspec.yaml изменился с момента создания файла pubspec.lock, пожалуйста, снова запустите «pub get». «

Я запустил« flutter pub get »и« flutter pub upgrade », это не помогло.

Я ожидал, что это запустит веб-сервер на порту 8080. Выходные данные

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

is

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 Ответ

1 голос
/ 09 июня 2019

Существует решение для этого. Нашел это здесь, 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

...