OS: Ubuntu 16.04.3 LTS
I was trying to run unit test for an angular project using
ng test
but it failed to start browser giving errorERROR [launcher]: Cannot start Chrome
.Even puppteer only runs in headless mode, for
headless: false
it gives errorUnhandledPromiseRejectionWarning: Unhandled promise rejection (rejection id: 1): Error: Failed to launch chrome!
Also on
xdg-open https://example.com
it gives the log/usr/bin/xdg-open: 778: /usr/bin/xdg-open: www-browser: not found/usr/bin/xdg-open: 778: /usr/bin/xdg-open: links2: not found/usr/bin/xdg-open: 778: /usr/bin/xdg-open: elinks: not found/usr/bin/xdg-open: 778: /usr/bin/xdg-open: links: not found/usr/bin/xdg-open: 778: /usr/bin/xdg-open: lynx: not found/usr/bin/xdg-open: 778: /usr/bin/xdg-open: w3m: not foundxdg-open: no method available for opening 'https://example.com/
So it's safe to say there's a problem with Chrome, and not the application/technology I am running.But I also installed google chrome using the following
wget https://dl.google.com/linux/linux_signing_key.pubsudo apt-key add linux_signing_key.pubsudo apt updatesudo apt install google-chrome-stable
and yet, nothing changed.
EDIT
the /usr/bin/xdg-open
file has the following, if it helps
# if BROWSER variable is not set, check some well known browsers insteadif [ x"$BROWSER" = x"" ]; then BROWSER=www-browser:links2:elinks:links:lynx:w3m if [ -n "$DISPLAY" ]; then BROWSER=x-www-browser:firefox:iceweasel:seamonkey:mozilla:epiphany:konqueror:chromium:google-chrome:$BROWSER fifi