Medium / phantomjs

NPM wrapper for installing phantomjs
Other
1.42k stars 435 forks source link

PhantomJS 2.5 beta #668

Open graingert opened 7 years ago

graingert commented 7 years ago

It would be great to try out the PhantomJS 2.5 Beta https://groups.google.com/forum/#!topic/phantomjs/AefOuwkgBh0 with yarn add phantomjs-prebuilt@next

TLDR

Probably not possible: maybe just use https://chromium.googlesource.com/chromium/src/+/lkgr/headless/README.md#Usage-via-the-DevTools-remote-debugging-protocol

AFAIK, the problem is that the statically linked phantomjs distributions are difficult to maintain, so the phantomjs team is moving towards dynamically linked binaries. This makes distributing phantomjs via npm much more complex because there are different binaries for each distro (Ubuntu xenial, ubuntu trusty, etc)

djedje72 commented 7 years ago

Really need the 2.5 Beta version to use ES2015 features :)

remojansen commented 7 years ago

I tried to create a npmrc file with the following contents:

phantomjs_cdnurl=https://bitbucket.org/ariya/phantomjs/downloads

The url contains phantomjs-2.5.0-beta-linux-ubuntu-xenial-x86_64.tar.gz but phantomjs-prebuilt is installing phantomjs-2.1.1-linux-x86_64.tar.bz2 can I somehow force it tonfetch the beta version?

graingert commented 7 years ago

@nicks any updates on this?

attiks commented 7 years ago

Manual work-around works, download from https://bitbucket.org/ariya/phantomjs/downloads/phantomjs-2.5.0-beta-linux-ubuntu-xenial-x86_64.tar.gz and extract phantomjs to node_modules/phantomjs-prebuilt/bin/phantomjs

graingert commented 7 years ago

@nicks @nanaya is phantomjs-prebuilt dead?

nicks commented 7 years ago

@graingert nope, but i don't really contribute to the project anymore. If someone wants to contribute a pull request for this, they're free to try. Here is the last failed attempt at this: https://github.com/Medium/phantomjs/pull/664

AFAIK, the problem is that the statically linked phantomjs distributions are difficult to maintain, so the phantomjs team is moving towards dynamically linked binaries. This makes distributing phantomjs via npm much more complex because there are different binaries for each distro (Ubuntu xenial, ubuntu trusty, etc)

If phantomjs 2.5 comes out of beta and the project is still on the dynamically-linked route, the best approach might be to deprecate the npm installer, and encourage people to use their OS distro package managers.

edhollinghurst commented 7 years ago

@attiks Sorry if this is a dumb question but I can't figure out how to implement your manual workaround.

After extracting the contents of https://bitbucket.org/ariya/phantomjs/downloads/phantomjs-2.5.0-beta-linux-ubuntu-xenial-x86_64.tar.gz, which files should I move from here to node_modules/phantomjs-prebuilt?

I tried just replacing the node_modules/phantomjs-prebuilt/bin/phantomjs file with the bin/phantomjs file but this didn't seem to work.

attiks commented 7 years ago

Our CI uses this, we no longer move, but we alter a node module, other solution is to move phantomjs-2.5.0-beta-ubuntu-xenial/bin/phantomjs

- npm i
- wget -N https://bitbucket.org/ariya/phantomjs/downloads/phantomjs-2.5.0-beta-linux-ubuntu-xenial-x86_64.tar.gz
- tar xvf phantomjs-2.5.0-beta-linux-ubuntu-xenial-x86_64.tar.gz
- chmod u+x phantomjs-2.5.0-beta-ubuntu-xenial/bin/phantomjs
- export PHANTOMJS_EXECUTABLE=phantomjs-2.5.0-beta-ubuntu-xenial/bin/phantomjs
- sed -i '/.*PHANTOMJS_EXECUTABLE.*/d' node_modules/backstopjs/core/util/runCasper.js
Naatan commented 7 years ago

Any way for us Linux users that don't use Ubuntu to try 2.5? I've tried building it but the build steps appear to be out of date.

mathieujobin commented 6 years ago

the beta build for trusty does not run on trusty...

0.33s$ phantomjs --version
phantomjs: /usr/lib/x86_64-linux-gnu/libstdc++.so.6: version `CXXABI_1.3.8' not found (required by phantomjs)
phantomjs: /usr/lib/x86_64-linux-gnu/libstdc++.so.6: version `GLIBCXX_3.4.21' not found (required by phantomjs)
phantomjs: /usr/lib/x86_64-linux-gnu/libstdc++.so.6: version `GLIBCXX_3.4.20' not found (required by phantomjs)
phantomjs: /usr/lib/x86_64-linux-gnu/libstdc++.so.6: version `CXXABI_1.3.9' not found (required by phantomjs)

I should not need to change the preinstalled glibc....

i see a beta2 for windows only?

anyway, I'll wait for the official release