angular-phonecat icon indicating copy to clipboard operation
angular-phonecat copied to clipboard

`npm run protractor` doesn't work on Mac OS X Yosemite machine

Open carusog opened this issue 11 years ago • 57 comments

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

carusog avatar Feb 12 '15 13:02 carusog

I got it working by changing package.json

Set devDependencies.protractor to be "*", removed node_modules, ran npm install and npm run update-webdriver

jpaljasma avatar Feb 12 '15 18:02 jpaljasma

I can confirm that the solution from @jpaljasma works.

gjermundgaraba avatar Feb 24 '15 17:02 gjermundgaraba

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.

  1. I followed the same steps to change the package.son for the protractor dependency and performed a npm install.
  2. I did 'npm run update-webdriver'
  3. If I do not have any errors in my test, everything looks fine
  4. 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

mannyfu avatar Mar 01 '15 22:03 mannyfu

@jpaljasma Thanks for your help, but it doesn't work here either.

carusog avatar Mar 03 '15 09:03 carusog

Worked for me, thanks!

ereze avatar Mar 05 '15 14:03 ereze

@jpaljasma How do I remove all the node_modules,? Should I just delete the node_modules folder or is there a command?

sai29 avatar Mar 06 '15 07:03 sai29

I just deleted the node_modules folder. It will be regenerated on npm install.

gjermundgaraba avatar Mar 06 '15 07:03 gjermundgaraba

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.

sai29 avatar Mar 06 '15 10:03 sai29

I had the same problem running linux (fedora 21) and the solution from jpaljasma worked for me as well.

skjolber avatar Mar 11 '15 13:03 skjolber

@jpaljasma’s solution works for me on Mac OS X 10.9.5.

HughxDev avatar Mar 14 '15 03:03 HughxDev

works for me

mmadej avatar Mar 17 '15 11:03 mmadej

@jpaljasma’s solution works for me on Mac OS X 10.10.2 as well, thanks a lot!

daple avatar Mar 17 '15 20:03 daple

same issue, steps from @jpaljasma worked great - thanks!

kevinhooke avatar Mar 28 '15 02:03 kevinhooke

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.

valsouche avatar Mar 29 '15 19:03 valsouche

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.

zanify avatar Mar 31 '15 18:03 zanify

@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.

lukenofurther avatar Apr 06 '15 22:04 lukenofurther

@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.

jsphstls avatar Apr 15 '15 16:04 jsphstls

@tintin34 solution also works for me on Mac OS X 10.10.3 - thanks!

akm avatar Apr 22 '15 01:04 akm

thanks @jpaljasma! worked like a charm

mlg87 avatar Apr 24 '15 16:04 mlg87

I had this same problem in Ubuntu. What worked for me

  • npm install chromedriver - This installed the chromedriver in angular-phonecat/node_modules/protractor/node_modules/chromedriver
  • copy the zip file from the lib directory 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.

palerdot avatar Apr 28 '15 06:04 palerdot