How to make Dart Editor find referenced packages

2019-09-06 20:42发布

问题:

In the Dart Editor (x64), I create a new project from the "Polymer Web Application" template.

Immediately after creation, Dart Editor runs pub get command, executes building workspace.

Then for every import directive, like

import 'package:polymer/polymer.dart';

I got the following error: Target of URI does not exist: 'package:polymer/polymer.dart'

How can I make Dart Editor understand references for standard libraries?

回答1:

I assume your pub-cache is corrupted which can usually be fixed by running pub cache repair from command line.