Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Error: spawn UNKNOWN - when attempting to use browserstack-local for the first time #33

Open
parky128 opened this issue May 22, 2017 · 11 comments

Comments

@parky128
Copy link

I am having issues trying to get browserstack-local to work having followed the documentation.

In my beforeLaunch I have:

console.log("Connecting local");
return new Promise(function(resolve, reject){
	exports.bs_local = new browserstack.Local();
	exports.bs_local.start({'key': exports.config.capabilities['browserstack.key'] }, function(error) {
		if (error) return reject(error);
		console.log('Connected. Now testing...');

		resolve();
	});
});

When attempting to run my protractor script, I get the following error:

Connecting local
C:\Users\rparker\AppData\Roaming\npm\node_modules\protractor\node_modules\q\q.js
:155
                throw e;
                ^

Error: spawn UNKNOWN
    at exports._errnoException (util.js:1018:11)
    at ChildProcess.spawn (internal/child_process.js:319:11)
    at exports.spawn (child_process.js:378:9)
    at Object.exports.execFile (child_process.js:143:15)
    at C:\Users\rparker\Documents\GitHub\interACT\node_modules\browserstack-loca
l\lib\Local.js:33:34
    at LocalBinary.binaryPath (C:\Users\rparker\Documents\GitHub\interACT\node_m
odules\browserstack-local\lib\LocalBinary.js:83:7)
    at Local.getBinaryPath (C:\Users\rparker\Documents\GitHub\interACT\node_modu
les\browserstack-local\lib\Local.js:228:19)
    at Local.start (C:\Users\rparker\Documents\GitHub\interACT\node_modules\brow
serstack-local\lib\Local.js:28:10)
    at C:\Users\rparker\Documents\GitHub\interACT\test\protractor-ie.conf.js:34:
24
    at beforeLaunch (C:\Users\rparker\Documents\GitHub\interACT\test\protractor-
ie.conf.js:32:12)

I don't think I have missed out any steps.

Looking at the stacktrace and the files it references, I can see it seems to be downloading a browserstack binary, does this happen at the start of each test run?

Thanks

@AnkurGel
Copy link
Member

Hi
The browserstack binary is downloaded just once.
This seems to be issue around binaryPath on Windows. We will check this soon and get back.

Thanks

@madjam002
Copy link

@AnkurGel Any news on this being fixed?

@deisterhold
Copy link

I was having this issue too and it turns out the binary would attempt to download, but my proxy blocked the request causing the download to fail. However, even though the download failed, there was a zero byte file created (at '%USERPROFILE%.browserstack\BrowserStackLocal.exe') on disk that prevented the download from being attempted again once I specified the correct proxy settings.

@LachlanStuart
Copy link

Even after deleting the .browserstack directory it would just re-download another 0-byte BrowserStackLocal.exe file. I don't have a proxy configured, nor do I have any kind of invasive corporate firewall that could be killing my connection, so I'm not sure why the download failed every time. Manually replacing that 0-byte file with https://s3.amazonaws.com/browserStack/browserstack-local/BrowserStackLocal.exe worked.

@valgussev
Copy link

If you arrived here and you are using linux alpine it just not supported according to this issue.

@jdcskillet
Copy link

If you arrived here and you are using linux alpine it just not supported according to this issue.

I'm currently having this issue as well... and am using alpine. So this is good to know. Any work around people have?

@Chiaro-K
Copy link

To whoever has this problem on Windows

Step 1: Delete the folder '%USERPROFILE%.browserstack
Step 2: Run the command again and when your antivirus pops up, add the BrowserStackLocal.exe to exceptions

--alternate to Step 2--
Deactivate your antivirus and run the command again.

@eisenreich
Copy link

eisenreich commented Jan 7, 2021

In my case it works after updating the version of node/npm and deps to latest, and delete the %USERPROFILE%/.browserstack folder

  • node: v14.8.0
  • npm: 6.14.7
  • testcafe-browser-provider-browserstack: ^1.13.2-alpha.1
    • browserstack-local@1.4.8

@ravindra237
Copy link

In my case it is working after deleting the %USERPROFILE%/.browserstack folder

@haideralii
Copy link

@ravindra237 where is this folder %USERPROFILE%/.browserstack, in my case I'm not running on browser stack local but on live

@ravindra237
Copy link

ravindra237 commented May 28, 2021

@haideralii - For me, I was unable to run browser stack locally. So post deleting the folder, I was able to run successfully in local.
But your case is running in browser-stack itself right? If yes, then you should not face this issue. Could you please elaborate more your case.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests