如何使用量角器解决'this fails on your system'错误?



我正在开发一个单独的web应用程序,遵循本教程:

https://docs.angularjs.org/tutorial

给我带来很大问题的显然是Protractor端到端测试工具的正确配置。我已经完成了之前的所有步骤(安装npm,bower,jasmine等)。然而,每当我尝试为Protractor做同样的操作时(当然是在正确的项目文件夹中),控制台输出如下:

angular-phonecat@0.0.0 protractor C:UsersMichał Szydłowskiangular-phonecat
> protractor test/protractor-conf.js
util.puts: Use console.log instead
Using ChromeDriver directly...
[launcher] Error: Could not find chromedriver at C:UsersMichał Szydłowskiangu
lar-phonecatnode_modulesprotractorseleniumchromedriver.exe
npm ERR! Windows_NT 6.3.9600
npm ERR! argv "C:\Program Files\nodejs\\node.exe" "C:\Program Files\nodejs
\node_modules\npm\bin\npm-cli.js" "run" "protractor"
npm ERR! node v0.12.3
npm ERR! npm  v2.9.1
npm ERR! code ELIFECYCLE
npm ERR! angular-phonecat@0.0.0 protractor: `protractor test/protractor-conf.js`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the angular-phonecat@0.0.0 protractor script 'protractor test
/protractor-conf.js'.
npm ERR! This is most likely a problem with the angular-phonecat package,
npm ERR! not with npm itself.
npm ERR! Tell the author that this fails on your system:
npm ERR!     protractor test/protractor-conf.js
npm ERR! You can get their info via:
npm ERR!     npm owner ls angular-phonecat
npm ERR! There is likely additional logging output above.
npm ERR! Please include the following file with any support request:
npm ERR!     C:UsersMichał Szydłowskiangular-phonecatnpm-debug.log
C:UsersMichał Szydłowskiangular-phonecat>

我尝试修改package.json文件以升级那里的protractor版本,或者手动添加karma命令行接口,但这些都没有帮助。有什么想法吗?

我注意到NPM在连接不好时表现得很不得体。下载的依赖关系可能会被破坏,因为对于NPM来说,只要有一个文件夹和"package.json"文件就足够了,但其他一些文件可能会丢失。我还注意到这种情况在Mac上发生得更频繁。

这会导致错误发生在不同的阶段,具体取决于使用破坏的依赖关系的位置。

我找到的唯一解决方案是一个接一个地出错,找到上面提到的依赖项,从node_modules中删除它的文件夹,并为包含此node_modules的包运行npm i(简称npm install)。

相关内容

最新更新