在dart-web-components上运行pub install会出错:
Pub install fail, HttpParserException: Connection closed before full header was received
/dart-web-components/build.dart --changed=packages\args\args.dart --changed=packages\args\src\utils.dart --changed=packages\logging\...
Failed with error code 255
Unable to open file: C:/dartapps/dart-web-components/packages/web_components/component_build.dart'file:///C:/dartapps/dart-web-components/build.dart': Error: line 8 pos 1: library handler failed
import'package:web_components / component_build.dart'; ^
在build.dart文件中有一个字符串
import 'package:web_components/component_build.dart';
编辑器显示错误
Cannot find referenced source: package:web_components/component_build.dart
component_build.dart包含错误
Cannot find referenced source: package:args/args.dart
Cannot find referenced source: package:web_components/dwc.dart
答案 0 :(得分:2)
我解决了这个问题。似乎Cache文件夹(Pub)已损坏。
我删除了文件夹Cache:
C:\用户\< 用户名> \应用程序数据\漫游\酒吧
然后我从命令行运行pub install
并且它可以工作。
我的操作系统是Windows 7。
答案 1 :(得分:0)
好的,所以看看你的输出:
Pub install fail, HttpParserException: Connection closed before full header was received
这是真正的问题。
/dart-web-components/build.dart --changed=packages\args\args.dart --changed=packages\args\src\utils.dart --changed=packages\logging\...
Failed with error code 255
Unable to open file: C:/dartapps/dart-web-components/packages/web_components/component_build.dart'file:///C:/dartapps/dart-web-components/build.dart': Error: line 8 pos 1: library handler failed
这些只是第一个问题造成的红色鲱鱼。
我看到你在Windows上。存在一个已知问题,即HTTP内容具有一些间歇性的非确定性故障。我还在调查,但很难追查。
每次尝试都会出现此错误吗?你做了多少次尝试?
抱歉这里有麻烦。
答案 2 :(得分:0)
我多次尝试过。 我现在将dart-web-components放到默认的package-root目录中。 Pub install现在产生
Pub install fail, Package "html5lib" doesn't have a pubspec.yaml file.
然而,编辑器显示相同的错误
Cannot find referenced source: package:web_components/component_build.dart
Cannot find referenced source: package:args/args.dart
等。几乎每个* .dart文件
答案 3 :(得分:0)
在pubscpec.yams
中添加了此内容html5lib: git:git://github.com/dart-lang/html5lib.git
现在我又来了
Pub install fail, HttpParserException: Connection closed before full header was received
答案 4 :(得分:0)
您是否使用代理访问互联网? DartEditor无法设置代理,因此无法访问pub包。