grunt-protractor-runner icon indicating copy to clipboard operation
grunt-protractor-runner copied to clipboard

running webdriver-manage update fails in package.json

Open mattp- opened this issue 10 years ago • 11 comments

As referenced here https://github.com/teerapap/grunt-protractor-runner/commit/165afbf621c2b2a575d9afc2191e953f8bb58b5f

npm http GET https://registry.npmjs.org/grunt-protractor-runner npm http 304 https://registry.npmjs.org/grunt-protractor-runner

[email protected] postinstall /home/autobuild/workspace/r10n-gui-PRs-continuous/node_modules/grunt-protractor-runner ./node_modules/.bin/webdriver-manager update

sh: ./node_modules/.bin/webdriver-manager: No such file or directory npm ERR! weird error 127 npm ERR! not ok code 0

looks like npm is in a different cwd than expected root? unsure if npm has an env var set like $NPM_ROOT that can be used to reliably know where root is.

mattp- avatar Aug 21 '14 17:08 mattp-

@mattp- I try some fix in v1.1.2. Can you try again?

teerapap avatar Aug 21 '14 18:08 teerapap

I am getting this error on 1.1.2

npm install] npm ERR! [email protected] postinstall: webdriver-manager update [11:38:19][npm install] npm ERR! Exit status 1 [11:38:19][npm install] npm ERR! [11:38:19][npm install] npm ERR! Failed at the [email protected] postinstall script. [11:38:19][npm install] npm ERR! This is most likely a problem with the grunt-protractor-runner package, [11:38:19][npm install] npm ERR! not with npm itself. [11:38:19][npm install] npm ERR! Tell the author that this fails on your system: [11:38:19][npm install] npm ERR! webdriver-manager update

This only appeared on our build servers yesterday so I assume some error has been introduced in a current release

MarkAPhillips avatar Aug 22 '14 10:08 MarkAPhillips

I am having the same issue.

npm ERR! [email protected] postinstall: webdriver-manager update npm ERR! Exit status 127 npm ERR! npm ERR! Failed at the [email protected] postinstall script. npm ERR! This is most likely a problem with the grunt-protractor-runner package, npm ERR! not with npm itself. npm ERR! Tell the author that this fails on your system: npm ERR! webdriver-manager update npm ERR! You can get their info via: npm ERR! npm owner ls grunt-protractor-runner npm ERR! There is likely additional logging output above.

npm ERR! System Linux 3.2.0-67-generic npm ERR! command "/usr/bin/node" "/usr/bin/npm" "install" npm ERR! cwd /home/rgomis/Projects/webserver/nxweb npm ERR! node -v v0.10.30 npm ERR! npm -v 1.4.21 npm ERR! code ELIFECYCLE npm WARN optional dep failed, continuing [email protected]

raulgomis avatar Aug 22 '14 12:08 raulgomis

@teerapap since there is a separate issue opened for this I will continue the discussion here. 1.1.2 still gives me the same error message as the users above. However, I am using Travis with Sauce Labs for Selenium, so I do not really need to update webdriver-manager, since I am not using Selenium locally. So 1.1.0 is stable at the moment. The issue goes away if you install protractor globally.

rtsio avatar Aug 22 '14 14:08 rtsio

It seems that it's due to these npm issues. https://github.com/npm/npm/issues/2872 https://github.com/npm/npm/issues/5001

The problem occurs if user's module, which has grunt-protractor-runner as dependency, also specifies protractor as dependency. So protractor will not be installed inside grunt-protractor-runner's node_modules but in the same level as grunt-protractor-runner and at the time postinstall step is invoked, protractor hasn't been downloaded/installed yet. So it cannot find the webdriver-manager script. If user's module does not specify protractor as dependency, it works fine.

I decide to move this postinstall hook to pretest hook because npm test requires this webdriver and add FAQ about run the webdriver-manager script manually if user needs it.

Hope it really fixes the problem.

teerapap avatar Aug 22 '14 16:08 teerapap

@mattp- @MarkAPhillips @raulgomis @rtsio please try v1.1.4

teerapap avatar Aug 22 '14 16:08 teerapap

yeah! it worked for me! thanks @teerapap

raulgomis avatar Aug 24 '14 18:08 raulgomis

pls upgrade protractor version, they have a fix for it: https://github.com/angular/protractor/blob/master/CHANGELOG.md

sonicoder86 avatar Sep 08 '14 14:09 sonicoder86

@blacksonic which fix do you mean?

teerapap avatar Sep 08 '14 15:09 teerapap

That updating webdriver fails. Apart from that protractor is 2 versions behind the main repo.

sonicoder86 avatar Sep 09 '14 06:09 sonicoder86

@blacksonic I think it fails because of npm issue not the protractor issue and I specify the protractor version in package.json as "protractor": "^1.0.0". According to https://www.npmjs.org/doc/misc/semver.html, it includes v1.2.0 which is the lastest version of protractor.

teerapap avatar Sep 10 '14 14:09 teerapap