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

running protractor as a script in package.json gives an error after tests are executed #4477

@mrafaqi

Description

@mrafaqi

Hi,

We recently decided to control easy installation of protractor on local machines (by specifying it in package.json) instead of installing individually with -g flag. So addition is something like this

"scripts": {
"protractor": "protractor protractor.config.js --directConnect"
}

After that when I try to execute protractor using
npm run protractor

It gives following console error after running tests.

npm ERR! Failed at the @ protractor script 'sudo protractor protractor.config.js --directConnect'.
npm ERR! This is most likely a problem with the package,
npm ERR! not with npm itself.

.....
....

Running protractor using following command works fine.
node_modules/protractor/bin/protractor protractor.config.js --directConnect

Also it works ok if protractor is installed as global package and run as below
protractor protractor.config.js --directConnect

Only problem that running it as scripts always gives errors after tests run is finished.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions