Michał Szydłowski
Michał Szydłowski

Reputation: 3409

How to solve 'this fails on your system' error with Protractor?

I'm developing a single web application, following this tutorial:

https://docs.angularjs.org/tutorial

What causes me great problems, is apparently the proper configuration of the Protractor end-to-end test tool. I have done all the previous steps (installing npm, bower, jasmine etc.). However, whenever I try to do the same for Protractor (being of course in the proper project folder), the console outputs this:

[email protected] protractor C:\Users\Michał Szydłowski\angular-phonecat
> protractor test/protractor-conf.js

util.puts: Use console.log instead
Using ChromeDriver directly...
[launcher] Error: Could not find chromedriver at C:\Users\Michał Szydłowski\angu
lar-phonecat\node_modules\protractor\selenium\chromedriver.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! [email protected] protractor: `protractor test/protractor-conf.js`

npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the [email protected] 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:\Users\Michał Szydłowski\angular-phonecat\npm-debug.log

C:\Users\Michał Szydłowski\angular-phonecat>

I tried modifying the package.json file to upgrade the protractor version there, or adding manualy the karma command line interface, but none of these helped. Any ideas?

Upvotes: 1

Views: 196

Answers (1)

Kirill Slatin
Kirill Slatin

Reputation: 6143

I've noticed that NPM behaves gracelessly at bad connection. Downloaded dependency may be broken because for NPM to indicate it is in place it is enough to have a folder and "package.json" file in it, but some other files may be missing. Also I noticed this happens on Mac more frequently.

This results in errors happening at different phases depending on where broken dependencies are used.

The only solution I found was going one error by one and find the mentioned dependency, delete it's folder from node_modules and run npm i (short hand for npm install) for the package containing this node_modules.

Upvotes: 2

Related Questions