If you encounter this issue, it’s a bug in phantomjs that prevents it from working properly when QT_QPA_PLATFORM environment variable is set.
The best way to solve this issue is to upgrade to the newest phantom, but if you cannot do it, you can unset the variable:
or give it an empty value, e.g.:
If you don’t want to type the command every time, you can one of the above to .bashrc or .profile
Here’s one of the related issues on GitHub: https://github.com/ariya/phantomjs/issues/14061