Closed shanep2300 closed 7 years ago
Are you still facing after this https://github.com/browserstack/browserstack-local-nodejs/issues/28 ?
Yes, as I would rather use the default one rather than a defined path.
Hey @shanep2300, I think this might be because of a failed download. Did you check/get some error object in the callback to start?
bs_local.start(bs_local_args, function(error) {
console.log("Error:", error);
});
Also, a 0kb file in that particular path should not be an issue as this module re-downloads the binary if it cannot start the binary / the binary is corrupted. So the 0kb file should be fixed on re-downloading (or cough-up a LocalError object if it fails to do so)
Hello @vedharish, This is how it's set up:
console.log("Connecting local");
exports.bs_local = new browserstack.Local();
exports.bs_local.start({
'key': exports.config.multiCapabilities['browserstack.key'],
'localIdentifier': exports.config.multiCapabilities['browserstack.localIdentifier']}, function(error) {
if (error) return reject(error);
console.log('Connected. Now testing...');
resolve();
});
This is the error I'm getting:
Error: spawn UNKNOWN
at exports._errnoException (util.js:1022:11)
at ChildProcess.spawn (internal/child_process.js:313:11)
at exports.spawn (child_process.js:380:9)
at Object.exports.execFile (child_process.js:143:15)
Ashwin, from BrowserStack support, helped me fix the spawn issue. Well half of it. The path to the binary needed the .exe. os.homedir() +'/binaries/BrowserStackLocal.exe'
. If it didn't have the .exe it would cause another spawn issue. I thought the path just had to point to the folder where the binary was located.
The other half of the problem still hasn't been fixed. I can't get this to work without the binary path defined.
Found a better solution for the path.
var path = require('path');
'binarypath': path.resolve(process.cwd()) + '/binaries/BrowserStackLocal.exe'
This will point the path to the working directory instead of the home directory.
This is after deleting the binary and re-initiating the test script to try and get a fresh binary.
Using version 1.3.0 on Windows 7.