`make serve` needs help on latest Dart versions
Closed this issue · 3 comments
For versions up to @2.16, I first needed to do dart pub get
and dart pub upgrade
to cope with errors like the following:
Analyzer language version: 2.13.0
SDK language version: 2.16.0
If you are getting this message and have the latest `analyzer` version, then a
new version of `analyzer` needs to be published. Check for an open issue at:
https://github.com/dart-lang/sdk/issues?q=is%3Aissue+is%3Aopen+No+published+analyzer+2.16.0
and thumbs up and/or subscribe to the existing issue, or file a new issue at
https://github.com/dart-lang/sdk/issues/new with the title
"No published analyzer available for language version 2.16.0".
From @2.17 onward, directly calling pub
is no longer supported, so make serve
fails with the following:
pub run build_runner serve
make: pub: No such file or directory
make: *** [serve] Error 1
I was able to get @2.17 to work by updating instances of pub run
in Makefile
to dart pub run
System info:
MacBook Pro 16-in, 2019
macOS Ventura 13.1
I realized now I completely misunderstood your comment.
I have crossed out the comment I wrote to prevent other misunderstandings.
I'm not sure this way is correct.
It works to me. I proceeded with the following steps though.
Before proceeding, I installed the latest version of flutter. Also I didn't install "Gnu make".
1. I modified this codes in pubspec.yaml like this
name: hauberk
environment:
sdk: '2.18.6'
dependencies:
malison: any
markdown: any
path: any
piecemeal: any
dev_dependencies:
build_runner: any
build_web_compilers: any
test: any
2. run "dart pub upgrade" (To run dart command, You should add dart path to PATH)
3. run "dart pub run --verbose build_runner serve" (--verbose is option.)
I hope this helps you.
Not sure what you mean by "correct". What I described above was sufficient for me on a clean checkout of Hauberk and various versions of Dart (installed and linked via Homebrew), so it's as "correct" as I need it to be. I haven't done any work with Dart other than to get this project to run, so if updating pubspec.yaml as you've described is "better" or "more idiomatic to Dart", go for it.
This latest commit should get the Makefile happy again as of the latest Dart build: 1f416a5