diff --git a/lib/src/pubspec.dart b/lib/src/pubspec.dart
index 74e9becd26e2b5919823fecfc53b4c81e7a2a393..3cfcf6abf1fa2dc9cbcf7bff24f080a014f472ea 100644
--- a/lib/src/pubspec.dart
+++ b/lib/src/pubspec.dart
@@ -348,7 +348,7 @@ class Pubspec {
           // Make the package dir absolute because for the entrypoint it'll just
           // be ".", which may be confusing.
           'Could not find a file named "pubspec.yaml" in '
-              '"${path.normalize(path.absolute(packageDir))}".',
+              '"${canonicalize(packageDir)}".',
           pubspecPath);
     }