selenium icon indicating copy to clipboard operation
selenium copied to clipboard

Running webdriver from an npm script fails

Open ilanbiala opened this issue 11 years ago • 7 comments

$ webdriver-manager start --standalone works for me, but $ npm run wd doesn't with this setup in my package.json:

"scripts": {
    "test-unit": "karma start karma.conf.js",

    "update-wd": "webdriver-manager update",
    "wd": "webdriver-manager start --standalone",
    "test-e2e": "protractor protractor.conf.js"
  }

I get this error message:

$ npm run wd

> <<project name>>@0.1.0 wd <<project path>>
> webdriver-manager start --standalone

Selenium Standalone is not present. Install with webdriver-manager update --standalone

npm ERR! Darwin 14.4.0
npm ERR! argv "node" "/usr/local/bin/npm" "run" "wd"
npm ERR! node v0.12.7
npm ERR! npm  v2.11.3
npm ERR! code ELIFECYCLE
npm ERR! <<project name>>@0.1.0 wd: `webdriver-manager start --standalone`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the <<project name>>@0.1.0 wd script 'webdriver-manager start --standalone'.
npm ERR! This is most likely a problem with the <<project name>> package,
npm ERR! not with npm itself.
npm ERR! Tell the author that this fails on your system:
npm ERR!     webdriver-manager start --standalone
npm ERR! You can get their info via:
npm ERR!     npm owner ls <<project name>>
npm ERR! There is likely additional logging output above.

npm ERR! Please include the following file with any support request:
npm ERR!     <<project path>>

ilanbiala avatar Jul 15 '15 17:07 ilanbiala

did you read the output message??

lukeis avatar Jul 15 '15 18:07 lukeis

(sorry.... more saying npm owner ls wd and you should know that is not this project)

lukeis avatar Jul 15 '15 18:07 lukeis

@lukeis I have selenium standalone, because as I said before, when I run webdriver-manager start --standalone, I have no issues and it works just fine.

ilanbiala avatar Jul 15 '15 18:07 ilanbiala

@ilanbiala ok, then log a bug against the 'wd' project

lukeis avatar Jul 15 '15 18:07 lukeis

did you run your update script?

The user here named their script 'wd'. I don't think it's related to the 'wd' npm module at all.

Jonahss avatar Aug 06 '15 23:08 Jonahss

Yes, as I said running the command itself works, but the npm alias doesn't.

ilanbiala avatar Aug 07 '15 05:08 ilanbiala

try this: first you need to install update: webdriver-manager update --standalone like it says in the npm error. then in package.json do:

"scripts": { "wd": "node node_modules/webdriver-manager/bin/webdriver-manager start --standalone" }

it worked for me.

caoxu2000 avatar Dec 11 '15 23:12 caoxu2000