aprok
aprok

Reputation: 1157

Protractor/node versions compatibility

I'm using protractor for e2e testing and grunt-task-runner package to run tests.

In my package.json file I have:

{
  ...,
  "grunt-protractor-runner": "^2.1.2",
  ...,
  "protractor": "^2.5.1",
  ...
}

And in my protractorConfig.js I use framework: 'jasmine2'

My intent is to use protractor 2.5.1 + grunt-protractor-runner 2.1.2 for node version 0.12.9, and to use protractor 3.0.0 + grunt-protractor-runner 3.0.0 for node version >=4.x.

The fact is, that when I run npm install either using node version 0.12.9 or 5.4.1, I always have the same protractor version in node_modules folder - 2.5.1 and corresponding grunt-protractor-runner.

What am I doing wrong? Any ideas would be highly appreciated.

Upvotes: 2

Views: 1619

Answers (1)

Steve Bennett
Steve Bennett

Reputation: 126637

You could try using the engines field:

{ "engines" : { "node" : ">=0.12.9 < 4" } }

But I don't think you can specify different versions of packages to install depending on the Node version.

Upvotes: 1

Related Questions