我正在尝试按照https://www.youtube.com/watch?v=YBNBr9ECXLo进行一项非常简单的测试。简而言之,我克隆了github.com/PolymerElements/seed-element.git,我安装了wct,我收到了标题中提到的错误。
我相信这是通常用于测试Polymer 1的方式。我假设这是因为使用Polymer 2和3的最新教程似乎依赖于polimer cli触发wct而不是直接触发wct。顺便说一句,因为我在公司工作聚合物1,我需要在本地正确运行测试。当然,我们将转向聚合物2,但不会很快发生。
我很奇怪它抱怨安装了wct,但结果告诉我它已正确安装。我再次尝试使用本地安装,以防它有所帮助,但同样的问题。
整个控制台错误
Error:
The web-component-tester Bower package is not installed as a dependency of this project (seed-element).
Please run this command to install:
bower install --save-dev web-component-tester
Web Component Tester >=6.0 requires that support files needed in the browser are installed as part of the project's dependencies or dev-dependencies. This is to give projects greater control over the versions that are served, while also making Web Component Tester's behavior easier to understand.
Expected to find a package.json or bower.json or .bower.json at: C:\dev\simple-examples\seed-element\bower_components\web-component-tester/
如果它有所帮助,这里有一些详细信息来自详细选项
...
2018-06-02 21:56:09.882:INFO:osjs.AbstractConnector:main: Started ServerConnector@16b4233{HTTP/1.1,[http/1.1]}{0.0.0.0:45645}
2018-06-02 21:56:09.884:INFO:osjs.Server:main: Started @946ms
21:56:09.884 INFO - Selenium Server is up and running
2018-06-02 21:56:10.182:INFO:osjshC.ROOT:qtp17311558-12: org.openqa.selenium.remote.server.WebDriverServlet-aac163: Initialising WebDriverServlet
21:56:10.244 INFO - Found handler: org.openqa.selenium.remote.server.commandhandler.Status@ec9ba
21:56:10.254 INFO - /status: Executing GET on /status (handler: Status)
Selenium server running on port 45645
Error:
The web-component-tester Bower package is not installed as a dependency of this project (seed-element).
Please run this command to install:
bower install --save-dev web-component-tester
Web Component Tester >=6.0 requires that support files needed in the browser are installed as part of the project's dependencies or dev-dependencies. This is to give projects greater control over the versions that are served, while also making Web Component Tester's behavior easier to understand.
Expected to find a package.json or bower.json or .bower.json at: C:\dev\simple-examples\seed-element\bower_components\web-component-tester/
嗯,不确定它是否与我的问题有关,顺便说一句,当我安装wct时,我看到两条可疑消息:" https://registry.bower.io/refs/Polymer/polymer返回404状态代码"和#34; bower web-component-tester#* mismatch在json(6.0.0)中声明的版本与已解析的版本(6.5.0)"
不同C:\dev\simple-examples\seed-element>bower install --save-dev web-component-tester
bower iron-component-page#^1.0.0 not-cached art://PolymerElements/iron-component-page#^1.0.0
bower iron-component-page#^1.0.0 resolve art://PolymerElements/iron-component-page#^1.0.0
bower polymer#^1.2.0 cached art://Polymer/polymer#v1.11.3
bower polymer#^1.2.0 validate v1.11.3 against art://Polymer/polymer#^1.2.0
bower web-component-tester#* not-cached https://github.com/Polymer/web-component-tester.git#*
bower web-component-tester#* resolve https://github.com/Polymer/web-component-tester.git#*
bower web-component-tester#^4.0.0 not-cached https://github.com/Polymer/web-component-tester.git#^4.0.0
bower web-component-tester#^4.0.0 resolve https://github.com/Polymer/web-component-tester.git#^4.0.0
bower web-component-tester#* download https://github.com/Polymer/web-component-tester/archive/v6.5.0.tar.gz
bower web-component-tester#^4.0.0 download https://github.com/Polymer/web-component-tester/archive/v4.3.6.tar.gz
bower web-component-tester#^4.0.0 extract archive.tar.gz
bower web-component-tester#* extract archive.tar.gz
bower web-component-tester#^4.0.0 resolved https://github.com/Polymer/web-component-tester.git#4.3.6
bower web-component-tester#* mismatch Version declared in the json (6.0.0) is different than the resolved one (6.5.0)
bower web-component-tester#* resolved https://github.com/Polymer/web-component-tester.git#6.5.0
bower polymer#^1.2.0 EREQUEST Request to https://registry.bower.io/refs/Polymer/polymer returned 404 status code.
Additional error details:
[object Object]