On Ubuntu for Windows, I found neither apt-get
nor npm
versions worked for me. What worked was the script from this comment.
For ease of use, I pasted the whole thing into a script file called install_phantomjs.sh
, made it executable (chmod u+x install_phantomjs.sh
), and then ran it (./install_phantomjs.sh
)