Karma launchers on Linux

435 Views Asked by At

I have a project which I was working on a Windows machine, however recently I've had to switch to Linux as my main dev machine and this is causing me some issues when trying to run JS unit tests using some karma launches, especially:

"karma-chrome-launcher" and "karma-firefox-launcher"

When I was still on the Windows machine and used to run tests, Chrome and Firefox used to open automatically to run tests against them, however in Linux I am having an issue where the browsers don't open and they error out - presumably having to do with permissions:

05 06 2019 14:34:11.915:ERROR [launcher]: Firefox stdout: 
05 06 2019 14:34:11.915:ERROR [launcher]: Firefox stderr: Running Firefox as root in a regular user's session is not supported.  ($HOME is /home/myuser which is owned by myuser.)

Same thing for Google Chrome:

05 06 2019 14:34:11.400:ERROR [launcher]: Chrome stdout: 
05 06 2019 14:34:11.400:ERROR [launcher]: Chrome stderr: [23234:23234:0605/143411.177215:ERROR:zygote_host_impl_linux.cc(89)] Running as root without --no-sandbox is not supported. See https://crbug.com/638180.

I'm new to Linux and tried various things such as trying to run using sudo or switching to sudo su first, but none of these seemed to help.

Anyone came across this issue or has pointers on what can be done to run these browsers possibly even without needing SU access?

Thanks

1

There are 1 best solutions below

3
On

If you must run them as root, do sudo su, then use the cd command with no destination given. Or cd /root

Also, if you run Chrome from the command line, it looks like doing the following may fix it.

$ sudo Chrome --no-sandbox