`npm run protractor` doesn't work on Mac OS X Yosemite machine
Hi, trying to run protractor on Mac OS X Yosemite, node v0.12.0, npm 2.5.1 I get the following error (notice [launcher] Error: Could not find chromedriver at /Users/papple/Devel/angular-phonecat/node_modules/protractor/selenium/chromedriver.exe ):
angular-phonecat git:(96a9b5b) npm run protractor
> [email protected] preprotractor /Users/papple/Devel/angular-phonecat
> npm run update-webdriver
> [email protected] preupdate-webdriver /Users/papple/Devel/angular-phonecat
> npm install
npm WARN package.json [email protected] No README data
> [email protected] install /Users/papple/Devel/angular-phonecat/node_modules/selenium-chromedriver
> node install
Downloading http://chromedriver.storage.googleapis.com/2.8/chromedriver_mac32.zip
Saving to /var/folders/41/0fkmgjl13lq332yk4l_fplbm0000gn/T/selenium-chromedriver115112-46057-c53p2z/chromedriver.zip
Receiving...
Received 781K...
Received 1564K...
Received 2346K...
Received 3128K...
Received 3967K...
Received 4749K...
Received 5531K...
Received 6313K...
Received 7096K...
Received 7878K...
Received 8311K total.
/var/folders/41/0fkmgjl13lq332yk4l_fplbm0000gn/T/selenium-chromedriver115112-46057-zqxgoo
Extracting zip contents
Writing location.txt file
Done. chromedriver binary available at /Users/papple/Devel/angular-phonecat/node_modules/selenium-chromedriver/bin/chromedriver
> [email protected] postinstall /Users/papple/Devel/angular-phonecat
> bower install
> [email protected] update-webdriver /Users/papple/Devel/angular-phonecat
> webdriver-manager update
selenium standalone is up to date.
chromedriver is up to date.
> [email protected] protractor /Users/papple/Devel/angular-phonecat
> protractor test/protractor-conf.js
util.puts: Use console.log instead
Using ChromeDriver directly...
[launcher] Error: Could not find chromedriver at /Users/papple/Devel/angular-phonecat/node_modules/protractor/selenium/chromedriver.exe
npm ERR! Darwin 14.1.0
npm ERR! argv "node" "/usr/local/bin/npm" "run" "protractor"
npm ERR! node v0.12.0
npm ERR! npm v2.5.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! /Users/papple/Devel/angular-phonecat/npm-debug.log
I got it working by changing package.json
Set devDependencies.protractor to be "*", removed node_modules, ran npm install and npm run update-webdriver
I can confirm that the solution from @jpaljasma works.
I tried @jpaljasma 's approach but it didn't work for me. Any idea? It doesn't happen when all the tests are successful, only when there is a failure. Let me elaborate a bit on what happened to me.
- I followed the same steps to change the package.son for the protractor dependency and performed a npm install.
- I did 'npm run update-webdriver'
- If I do not have any errors in my test, everything looks fine
- If there is any test failed, then I got the following trace (same exact trace as before the change)
npm ERR! Darwin 14.1.0
npm ERR! argv "node" "/usr/local/bin/npm" "run" "protractor"
npm ERR! node v0.12.0
npm ERR! npm v2.5.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! /Users/papple/Devel/angular-phonecat/npm-debug.log
@jpaljasma Thanks for your help, but it doesn't work here either.
Worked for me, thanks!
@jpaljasma How do I remove all the node_modules,? Should I just delete the node_modules folder or is there a command?
I just deleted the node_modules folder. It will be regenerated on npm install.
Thanks. It works fine when all the tests pass, but for a failing tests it shows which tests are failing and an error code 1 subsequently exits with the same error as for @mannyfu above.
I had the same problem running linux (fedora 21) and the solution from jpaljasma worked for me as well.
@jpaljasma’s solution works for me on Mac OS X 10.9.5.
works for me
@jpaljasma’s solution works for me on Mac OS X 10.10.2 as well, thanks a lot!
same issue, steps from @jpaljasma worked great - thanks!
On macbook pro Yosemite, I solved the same error by downloading : https://sites.google.com/a/chromium.org/chromedriver/downloads manualy and copy in the good repertory. This error is due to a damage ZIP file.
I hope you'll resolve your problem.
I just followed @tintin34 suggestion and it worked for me, also on a mbp yosemite. Was stuck with e2e test on the angular tutorial, downloaded the mac zip from the linked repository, unzipped it and put it in the ... /node_modules/protractor/selenium/ directory.
@tintin3's solution worked for me. I'm on Yosemite 10.10.2. The existing chromedriver zip file would not extract, but the 2.14 mac zip downloaded from http://chromedriver.storage.googleapis.com/index.html?path=2.14/ unzipped fine and protractor ran alright.
@tintin34 solution also worked for me.
I ran npm run update-webdriver after and received:
selenium standalone is up to date. chromedriver is up to date.
@tintin34 solution also works for me on Mac OS X 10.10.3 - thanks!
thanks @jpaljasma! worked like a charm
I had this same problem in Ubuntu. What worked for me
npm install chromedriver- This installed the chromedriver inangular-phonecat/node_modules/protractor/node_modules/chromedriver- copy the zip file from the
libdirectory from the above installed location and put it in/angular-phonecat/node_modules/protractor/selenium/ - unzip the copied zip file to extract the binary. Now run
npm run protractor
The problems for me seems to be invalid chromedriver zip file in /angular-phonecat/node_modules/protractor/selenium/. Getting the correct zip file and extracting the binary solved the issue.
There seems to too much issues on this on different OSes. Angular team should make a better documentation on this problem.