Skip to content
This repository was archived by the owner on Feb 26, 2024. It is now read-only.

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

Closed
carusog opened this issue Feb 12, 2015 · 57 comments
Closed

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

carusog opened this issue Feb 12, 2015 · 57 comments

Comments

@carusog
Copy link

carusog commented Feb 12, 2015

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

> angular-phonecat@0.0.0 preprotractor /Users/papple/Devel/angular-phonecat
> npm run update-webdriver


> angular-phonecat@0.0.0 preupdate-webdriver /Users/papple/Devel/angular-phonecat
> npm install

npm WARN package.json karma-chrome-launcher@0.1.7 No README data

> selenium-chromedriver@0.0.2 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

> angular-phonecat@0.0.0 postinstall /Users/papple/Devel/angular-phonecat
> bower install


> angular-phonecat@0.0.0 update-webdriver /Users/papple/Devel/angular-phonecat
> webdriver-manager update

selenium standalone is up to date.
chromedriver is up to date.

> angular-phonecat@0.0.0 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! 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!     /Users/papple/Devel/angular-phonecat/npm-debug.log
@jpaljasma
Copy link

I got it working by changing package.json

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

@gjermundgaraba
Copy link

I can confirm that the solution from @jpaljasma works.

@mannyfu
Copy link

mannyfu commented Mar 1, 2015

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! 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! /Users/papple/Devel/angular-phonecat/npm-debug.log

@carusog
Copy link
Author

carusog commented Mar 3, 2015

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

@ereze
Copy link

ereze commented Mar 5, 2015

Worked for me, thanks!

@sai29
Copy link

sai29 commented Mar 6, 2015

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

@gjermundgaraba
Copy link

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

@sai29
Copy link

sai29 commented Mar 6, 2015

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.

@skjolber
Copy link

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

@HughxDev
Copy link

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

@mmadej
Copy link

mmadej commented Mar 17, 2015

works for me

@daple
Copy link

daple commented Mar 17, 2015

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

@kevinhooke
Copy link

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

@valsouche
Copy link

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.

@zanify
Copy link

zanify commented Mar 31, 2015

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.

@lukenofurther
Copy link

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

@jsphstls
Copy link

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

@akm
Copy link

akm commented Apr 22, 2015

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

@mlg87
Copy link

mlg87 commented Apr 24, 2015

thanks @jpaljasma! worked like a charm

@palerdot
Copy link

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.

@karlli1976
Copy link

Thanks you @jpaljasma , your solution works for me :-)

Yosemite: 10.10.3

@sygint
Copy link

sygint commented May 6, 2015

Thanks @jpaljasma, solution worked, Ubuntu 14.04

@ygarbage
Copy link

ygarbage commented May 9, 2015

Thanks @jpaljasma, it worked on Debian 7.8.

@nickleus
Copy link

@Tintin34 thx :) downloaded the zip to ~/Downloads
unzipped it
copied the file "chromedriver" to folder /path-to-/angular-phonecat/node_modules/protractor/selenium/

@valsouche
Copy link

You're welcome :)

@halfzebra
Copy link

I have managed to fix similar issue by updating Java.

@mayra-cabrera
Copy link

Thanks @Tintin34! Your solution works on OS X 10.10.3 :)

@machinefixer
Copy link

@jpaljasma 's solution works for me, thx!

@warles34
Copy link

@Tintin34 solution solved my problem, and looks more solid and safe =D

@frak
Copy link

frak commented Oct 16, 2015

Thanks @Alecsandre - your solution worked for me

@AshCoolman
Copy link

I had to ensure I run webdriver-manager update from the version being used in the npm module e.g.
./node_modules/protractor/bin/webdriver-manager update

@amandaol
Copy link

@Alecsandre fix + @jpaljasma fix worked for me.

While the first fix alone seems to do the trick, adding @jpaljasma removed the rest of the errors that were printing out.

@jasunde
Copy link

jasunde commented Dec 8, 2015

On Mac OS X 10.11.1 I find that replacing chromeOnly: true with directConnect: true in test/protractor-conf.js solves the error without any additional npm update-webdriver.

@amaechler
Copy link

@jasunde fix worked for me.

@McAlyster
Copy link

@jasunde fix worked for me

@stevenluong
Copy link

@jasunde fix worked for me as well,thanks !

@SingpointGitHub
Copy link

@jasunde fix worked for me on Windows 10 x64

@rpajaziti
Copy link

@Tintin34 or now @valsouche solution worked for me. Tried almost every other solution but without luck.
If you dont have selenium folder under protractor(like me), then create a folder with that name and paste chromedriver in there. Try this solution before others. It will save your time, belive me.

@chadlajeunesse
Copy link

@jasunde fix also worked for me, thanks.

@jonathanboswell
Copy link

So spent a good bit of time looking into "Why?" @jasunde fix works.

In the office here we have Linux and Mac workstations. The default path to Chrome binary in Linux is /usr/bin/google-chrome and in OSX 10.10 it's /Applications/Google\ Chrome.app/Contents/MacOS/Google\ Chrome

When 'npm install' builds 'node_modules' and if that folder gets added to the Git repository of a project where users have different operating systems, protractor isn't able to find the Chrome executable.

A simple test which shows if this is the problem:
Fails: npm run protractor
But works: protractor ./path/to/protractor.conf.js

@gkalpak
Copy link
Member

gkalpak commented Mar 15, 2016

And that's a good examples of the reasons why one should not commit the node_modules/ directory 😃

@jonathanboswell
Copy link

Totally @gkalpak! And we fixed that stat on the dev's repository who had done that

@kematzy
Copy link

kematzy commented Mar 21, 2016

@jasunde fix worked for me on Mac OS X 10.11.3 (El Capitan) with node 5.0.0. Thanks a lot!

@liebecampbellroberts
Copy link

Hi,

I am using Mac OSX Yosimite 10.10.5

Just to say that I had to set "directConnect: true" in the protractor-conf.js file AND change "baseUrl", to 127.0.0.1:8000 (probably because I have not set the 127... to 'localhost' in my hosts file). So protractor-conf.js looks something like this:

...
directConnect: true,

chromeOnly: true,

baseUrl: 'http://127.0.0.1:8000/',
...

Thanks @Alecsandre and thanks guys, helped a lot!

gkalpak added a commit to gkalpak/angular-phonecat that referenced this issue Apr 11, 2016
…s for the post-1.5.0 era

This commit and the accompanying updates to the tutorial steps constitute a major re-structuring of
the tutorial app's codebase, aiming at applying established best practices (in terms of file
naming/layout and code organization) and utilizing several new features and enhancements (most
notably components) introduced in recent versions of Angular (especially v1.5).

Apart from the overall changes, two new chapters were introduced: one on components and one on code
organization.

--
In the process several other things were (incidentally) taken care of, including:

* Dependencies were upgraded to latest versions.
* Animations were polished.
* Outdated links were updated.

--
This was inspired by (and loosely based on) angular#289.
Mad props to @teropa for leading the way :)

Fixes angular#198
Fixes angular#214
Fixes angular#224
Fixes angular#230
Fixes angular#243
Fixes angular#246
Fixes angular#252
Fixes angular#277
Fixes angular#286
Fixes angular#295
Fixes angular#303
Fixes angular#304
Fixes angular#323
Fixes angular#324

Closes angular#268
Closes angular#270
Closes angular#278
Closes angular#280
Closes angular#289
Closes angular#309
Closes angular#311
Closes angular#319
gkalpak added a commit to gkalpak/angular-phonecat that referenced this issue Apr 11, 2016
…s for the post-1.5.0 era

This commit and the accompanying updates to the tutorial steps constitute a major re-structuring of
the tutorial app's codebase, aiming at applying established best practices (in terms of file
naming/layout and code organization) and utilizing several new features and enhancements (most
notably components) introduced in recent versions of Angular (especially v1.5).

Apart from the overall changes, two new chapters were introduced: one on components and one on code
organization.

--
In the process several other things were (incidentally) taken care of, including:

* Dependencies were upgraded to latest versions.
* Animations were polished.
* Outdated links were updated.
* The app's base URL was changed to `/` (instead of `/app/`).

--
This was inspired by (and loosely based on) angular#289.
Mad props to @teropa for leading the way :)

--
The old version of the tutorial, that is compatible with Angular version 1.4 or older, has been
saved in the `pre-v1.5.0-snapshot` branch. The `v1.4.x` version of the tutorial should be pointed
to that branch instead of `master`.

Fixes angular#198
Fixes angular#214
Fixes angular#224
Fixes angular#230
Fixes angular#243
Fixes angular#246
Fixes angular#252
Fixes angular#277
Fixes angular#286
Fixes angular#295
Fixes angular#303
Fixes angular#304
Fixes angular#323
Fixes angular#324

Closes angular#268
Closes angular#270
Closes angular#278
Closes angular#280
Closes angular#289
Closes angular#309
Closes angular#311
Closes angular#319
gkalpak added a commit to gkalpak/angular-phonecat that referenced this issue Apr 11, 2016
…s for the post-1.5.0 era

This commit and the accompanying updates to the tutorial steps constitute a major re-structuring of
the tutorial app's codebase, aiming at applying established best practices (in terms of file
naming/layout and code organization) and utilizing several new features and enhancements (most
notably components) introduced in recent versions of Angular (especially v1.5).

Apart from the overall changes, two new chapters were introduced: one on components and one on code
organization.

--
In the process several other things were (incidentally) taken care of, including:

* Dependencies were upgraded to latest versions.
* Animations were polished.
* Outdated links were updated.
* The app's base URL was changed to `/` (instead of `/app/`).

BTW, I have tested with the following versions on Node (on Windows 10) and everything seems to work fine:

* 0.11.16
* 4.2.6
* 4.4.2
* 5.10.0

--
This was inspired by (and loosely based on) angular#289.
Mad props to @teropa for leading the way :)

--
The old version of the tutorial, that is compatible with Angular version 1.4 or older, has been
saved in the `pre-v1.5.0-snapshot` branch. The `v1.4.x` version of the tutorial should be pointed
to that branch instead of `master`.

Fixes angular#198
Fixes angular#214
Fixes angular#224
Fixes angular#230
Fixes angular#243
Fixes angular#246
Fixes angular#252
Fixes angular#277
Fixes angular#286
Fixes angular#295
Fixes angular#303
Fixes angular#304
Fixes angular#323
Fixes angular#324

Closes angular#268
Closes angular#270
Closes angular#278
Closes angular#280
Closes angular#289
Closes angular#309
Closes angular#311
Closes angular#319
gkalpak added a commit to gkalpak/angular-phonecat that referenced this issue Apr 12, 2016
…s for the post-1.5.0 era

This commit and the accompanying updates to the tutorial steps constitute a major re-structuring of
the tutorial app's codebase, aiming at applying established best practices (in terms of file
naming/layout and code organization) and utilizing several new features and enhancements (most
notably components) introduced in recent versions of Angular (especially v1.5).

Apart from the overall changes, two new chapters were introduced: one on components and one on code
organization.

--
In the process, several other things were (incidentally) taken care of, including:

* Dependencies were upgraded to latest versions.
* Animations were polished.
* Outdated links were updated.
* The app's base URL was changed to `/` (instead of `/app/`).

BTW, this has been tested with the following versions of Node (on Windows 10) and everything worked
fine:

* 0.11.16
* 4.2.6
* 4.4.2
* 5.10.0

--
This was inspired by (and loosely based on) angular#289.
Mad props to @teropa for leading the way :)

--
**Note:**
The old version of the tutorial, that is compatible with Angular version 1.4 or older, has been
saved on the `pre-v1.5.0-snapshot` branch. The `v1.4.x` version of the tutorial should be pointed
to that branch instead of `master`.

--
Related to angular/angular.js#14416.
Related to angular/angular-seed#329.
Related to angular/angular-seed#333.

---
Fixes angular#198
Fixes angular#214
Fixes angular#224
Fixes angular#230
Fixes angular#243
Fixes angular#246
Fixes angular#252
Fixes angular#277
Fixes angular#286
Fixes angular#295
Fixes angular#303
Fixes angular#304
Fixes angular#323
Fixes angular#324

Closes angular#268
Closes angular#270
Closes angular#278
Closes angular#280
Closes angular#289
Closes angular#309
Closes angular#311
Closes angular#319
@jquerygeek
Copy link

Still having the same issue as mentioned by @mannyfu
works fike when test pass, but getting error with failed test.
any idea? @jpaljasma

gkalpak added a commit that referenced this issue May 24, 2016
…s for the post-1.5.0 era

This commit and the accompanying updates to the tutorial steps constitute a major re-structuring of
the tutorial app's codebase, aiming at applying established best practices (in terms of file
naming/layout and code organization) and utilizing several new features and enhancements (most
notably components) introduced in recent versions of Angular (especially v1.5).

Apart from the overall changes, two new chapters were introduced: one on components and one on code
organization.

--
In the process, several other things were (incidentally) taken care of, including:

* Dependencies were upgraded to latest versions.
* Animations were polished.
* Outdated links were updated.
* The app's base URL was changed to `/` (instead of `/app/`).

BTW, this has been tested with the following versions of Node (on Windows 10) and everything worked
fine:

* 0.11.16
* 4.2.6
* 4.4.2
* 5.10.0

--
This was inspired by (and loosely based on) #289.
Mad props to @teropa for leading the way :)

--
**Note:**
The old version of the tutorial, that is compatible with Angular version 1.4 or older, has been
saved on the `pre-v1.5.0-snapshot` branch. The `v1.4.x` version of the tutorial should be pointed
to that branch instead of `master`.

--
Related to angular/angular.js#14416.
Related to angular/angular-seed#329.
Related to angular/angular-seed#333.

---
Fixes #198
Fixes #214
Fixes #224
Fixes #230
Fixes #243
Fixes #246
Fixes #252
Fixes #277
Fixes #286
Fixes #295
Fixes #303
Fixes #304
Fixes #323
Fixes #324

Closes #268
Closes #270
Closes #278
Closes #280
Closes #289
Closes #309
Closes #311
Closes #319
gkalpak added a commit that referenced this issue May 24, 2016
…s for the post-1.5.0 era

This commit and the accompanying updates to the tutorial steps constitute a major re-structuring of
the tutorial app's codebase, aiming at applying established best practices (in terms of file
naming/layout and code organization) and utilizing several new features and enhancements (most
notably components) introduced in recent versions of Angular (especially v1.5).

Apart from the overall changes, two new chapters were introduced: one on components and one on code
organization.

--
In the process, several other things were (incidentally) taken care of, including:

* Dependencies were upgraded to latest versions.
* Animations were polished.
* Outdated links were updated.
* The app's base URL was changed to `/` (instead of `/app/`).

BTW, this has been tested with the following versions of Node (on Windows 10) and everything worked
fine:

* 0.11.16
* 4.2.6
* 4.4.2
* 5.10.0

--
This was inspired by (and loosely based on) #289.
Mad props to @teropa for leading the way :)

--
**Note:**
The old version of the tutorial, that is compatible with Angular version 1.4 or older, has been
saved on the `pre-v1.5.0-snapshot` branch. The `v1.4.x` version of the tutorial should be pointed
to that branch instead of `master`.

--
Related to angular/angular.js#14416.
Related to angular/angular-seed#329.
Related to angular/angular-seed#333.

---
Fixes #198
Fixes #214
Fixes #224
Fixes #230
Fixes #243
Fixes #246
Fixes #252
Fixes #277
Fixes #286
Fixes #295
Fixes #303
Fixes #304
Fixes #323
Fixes #324

Closes #268
Closes #270
Closes #278
Closes #280
Closes #289
Closes #309
Closes #311
Closes #319
@carrigmore
Copy link

I find add sudo at the begin of the command will resolve the problem.

@schandra-rpx
Copy link

chromeOnly: true,
directConnect: true

this worked for me in osx 10.11.5

@gkalpak
Copy link
Member

gkalpak commented Jun 28, 2016

@schandra-rpx, ooc is chromeOnly: true necessary? Afaict, the version of protractor used in the tutorial only cares about directConnect: true.

@norbertsienkiewicz
Copy link

I was able to run via protractor ./test/protractor.config.js, but couldn't make it from npm run test-e2e (which had the same command as I was using in command line).

@AshCoolman fix worked for me OSX El Capitan (10.11.4)

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests