Skip to content

Commit 2e3f4a3

Browse files
committed
Local: Revert writing tunnel file into working dir, document npm fix
Revert "On linux, EACCES open ... BrowserStackLocal error. Fixes #91" This reverts commit c27a2ad Documents how to avoid the issue described in #91 by configuring npm properly. Ref #91 Fixes #105
1 parent 82595cb commit 2e3f4a3

File tree

2 files changed

+13
-7
lines changed

2 files changed

+13
-7
lines changed

README.md

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,12 @@ You can also install locally and run the local binary:
1515
npm install browserstack-runner
1616
node_modules/.bin/browserstack-runner
1717

18+
If you're getting an error `EACCES open ... BrowserStackLocal`, configure npm to install modules using something other than the default "nobody" user:
19+
20+
npm -g config set user [user]
21+
22+
Where `[user]` is replaced with a local user with enough permissions.
23+
1824
## Configuration
1925

2026
To run browser tests on BrowserStack infrastructure, you need to create a `browserstack.json` file in project's root directory (the directory from which tests are run), by running this command:

lib/local.js

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ var Log = require('./logger'),
44
fs = require('fs'),
55
http = require('http'),
66
windows = ((process.platform.match(/win32/) || process.platform.match(/win64/)) !== null),
7-
localBinary = process.cwd() + '/BrowserStackLocal' + (windows ? '.exe' : ''),
7+
localBinary = __dirname + '/BrowserStackLocal' + (windows ? '.exe' : ''),
88
utils = require('./utils'),
99
config = require('./config');
1010

@@ -61,30 +61,30 @@ var Tunnel = function Tunnel(key, port, uniqueIdentifier, callback) {
6161

6262
function getTunnelOptions(key, uniqueIdentifier) {
6363
var options = [key];
64-
64+
6565
if (config.debug) {
6666
options.push('-v');
6767
}
68-
68+
6969
if (!uniqueIdentifier) {
7070
options.push('-force');
7171
options.push('-onlyAutomate');
7272
} else {
7373
options.push('-localIdentifier ' + uniqueIdentifier);
7474
}
75-
75+
7676
var proxy = config.proxy;
77-
77+
7878
if (proxy) {
7979
options.push('-proxyHost ' + proxy.host);
8080
options.push('-proxyPort ' + proxy.port);
81-
81+
8282
if (proxy.username && proxy.password) {
8383
options.push('-proxyUser ' + proxy.username);
8484
options.push('-proxyPass ' + proxy.password);
8585
}
8686
}
87-
87+
8888
return options;
8989
}
9090

0 commit comments

Comments
 (0)