pghalliday / node-BrowserStackTunnel

https://www.npmjs.com/package/browserstacktunnel-wrapper
MIT License
17 stars 24 forks source link

spawn EACCES with protractor #25

Open notVitaliy opened 8 years ago

notVitaliy commented 8 years ago

I'm getting the following error when running protractor:

Error: spawn EACCES
    at exports._errnoException (util.js:953:11)
    at ChildProcess.spawn (internal/child_process.js:302:11)
    at exports.spawn (child_process.js:372:9)
    at BrowserStackTunnel._startTunnel (/app/node_modules/browserstacktunnel-wrapper/src/BrowserStackTunnel.js:150:19)
    at BrowserStackTunnel.startTunnel (/app/node_modules/browserstacktunnel-wrapper/src/BrowserStackTunnel.js:167:12)
    at BrowserStackTunnel.start (/app/node_modules/browserstacktunnel-wrapper/src/BrowserStackTunnel.js:176:12)
    at exports.config.beforeLaunch (/app/config/protractor.conf.js:47:31)
    at /app/node_modules/protractor/built/util.js:48:49
    at Function.promise (/app/node_modules/q/q.js:682:9)
    at Object.runFilenameOrFn_ (/app/node_modules/protractor/built/util.js:38:16)

I'm running this using the beforeLaunch function for protractor, here is my code:

  beforeLaunch: function(done) {
    return browserStackTunnel.start(function (startError) {
      if (startError) return done(startError);

      return true;
    });
  },

ubunutu: 16.04 node: 6.2.0 npm: 3.8.9

The error seems to be a permissions error, I've chown'd the entire directory to the proper user:group but that didn't fix it.

Let me know if you need any more info.

notVitaliy commented 8 years ago

@pghalliday Changing spawn to exec here:

https://github.com/pghalliday/node-BrowserStackTunnel/blob/master/src/BrowserStackTunnel.js#L150

Seems to have fixed my issue.

aripalo commented 8 years ago

In case you (or someone else) still has this problem Error: spawn EACCES:

Try chaning the tunnel binary location (via the config):

  osxBin: 'your_bin_dir', // optionally override the default bin directory for the OSX binary
  linux32Bin: 'your_bin_dir', // optionally override the default bin directory for the Linux 32 bit binary
  linux64Bin: 'your_bin_dir', // optionally override the default bin directory for the Linux 64 bit binary
  win32Bin: 'your_bin_dir', // optionally override the default bin directory for the win32 binary

I specified the binary location to be within my project/repo root (and of course remember to gitignore that binary) and after that everything works.