path_pubspec_does_not_exist
The directory '{0}' doesn't contain a pubspec.
Description
#The analyzer produces this diagnostic when a dependency has a path
key
that references a directory that doesn't contain a pubspec.yaml
file.
Example
#Assuming that the directory local_package
doesn't contain a file
pubspec.yaml
, the following code produces this diagnostic because it's
listed as the path of a package:
yaml
name: example
dependencies:
local_package:
path: local_package
Common fixes
#If the path is intended to be the root of a package, then add a
pubspec.yaml
file in the directory:
yaml
name: local_package
除非另有说明,文档之所提及适用于 Dart 3.7.3 版本,本页面最后更新时间: 2025-05-08。 查看文档源码 或者 报告页面问题。