-
Notifications
You must be signed in to change notification settings - Fork 1.6k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Pub error message when version is not correct format is misleading #21229
Comments
cc @munificent. |
Fixed with https://codereview.chromium.org/632483002/ Now pub will suggest a fix: Example: $ pub get Added Fixed label. |
This comment was originally written by @mezoni
In this case the following message would be shorter and more informative. Error on line 3, column 10 of pubspec.yaml: version number should be in a numeric format "MAJOR.MINOR.PATCH". ... MAJOR.MINOR.PATCH |
This issue has been moved to dart-lang/pub#1156. |
If I create a pubspec.yaml containing the following:
name: my_test
version: 1.0.0
Then "pub get" works fine. However, if I change it to:
name: my_test
version: 1.0
Then "pub get" gives the following error:
Error in pubspec for package "my_test" loaded from pubspec.yaml:
"version" field must be a string, but was "1.0".
The error message ("must be a string") doesn't seem to match with the problem. It would be better if the error indicated the expected format for a version (this confuses me every single time!).
The text was updated successfully, but these errors were encountered: