Skip to content
This repository has been archived by the owner on Jul 24, 2019. It is now read-only.

PhantomJS not found on PATH #722

Open
ZappMH opened this issue Jul 4, 2017 · 18 comments
Open

PhantomJS not found on PATH #722

ZappMH opened this issue Jul 4, 2017 · 18 comments

Comments

@ZappMH
Copy link

ZappMH commented Jul 4, 2017

Hi everyone,
We had projects building on a Jenkins Slave server, and using phantomJS
Until last week, everythink worked fine

_> [email protected] install /home/jenkins_slave/workspace/Editorial_Gulp/EditorialIhm/src/main/webapp/node_modules/phantomjs-prebuilt

node install.js

Considering PhantomJS found at /lun/app1/tools/node-v6.4.0-linux-x64/bin/phantomjs_

But since this week, when we launch the exact same build, we have this

_> [email protected] install /home/jenkins_slave/workspace/Editorial_Gulp/EditorialIhm/src/main/webapp/node_modules/phantomjs-prebuilt

node install.js

PhantomJS not found on PATH
Downloading https://github.com/Medium/phantomjs/releases/download/v2.1.1/phantomjs-2.1.1-linux-x86_64.tar.bz2_

(then the download fails because the server cannot access github for security reasons)

The problem is that phantomJS is in the server, and its location is declared in the variable $PATH of the user launching the build.

I am unaware of any change that may have occur on the platform, so I do not know where to begin to search.

Any help or advice would be great :)

Thanks in advance.

@hms181231
Copy link

I also met

@shgattu
Copy link

shgattu commented Jul 11, 2017

I have same issues

@9r0x
Copy link

9r0x commented Jul 17, 2017

same issue

@LarsVonQualen
Copy link

LarsVonQualen commented Jul 25, 2017

How is this even a problem? Does anyone know why Chrome for instance is flagging the url? It's basically just a redirect to Amazon S3, so is the problem S3? Is it flagged because someone uses Github to distribute malware, and then as a consequence other assets from different projects is also flagged?

It's really annoying because it have broken our CI build :D

@szelpe
Copy link

szelpe commented Jul 25, 2017

Please let me know if you have a solution for this issue as it breaks our CI build as well :\

@dave000
Copy link

dave000 commented Jul 26, 2017

We found the quick fix for the issue by overriding the PHANTOMJS_CDNURL env variable and setting it to our own URL. You can also use any URL here.
This is the default CDN Url: https://github.com/Medium/phantomjs/releases/download/v2.1.1/ and the install.js adds phantomjs-2.1.1-windows.zip to the end.
So if you override the env variable like https://myOwnRepoUrl.com/folder and you have the content here https://myOwnRepoUrl.com/folder/phantomjs-2.1.1-windows.zip it should work.

@kuangcaibao
Copy link

this works for me

@JoeKahl
Copy link

JoeKahl commented Aug 23, 2017

C:\Users\jkahl1\Source\Repos\digital-advisor-fe>npm install

[email protected] install C:\Users\jkahl1\Source\Repos\digital-advisor-fe\node_modules\karma-phantomjs-launcher\node_modules\phantomjs-prebuilt
node install.js

PhantomJS not found on PATH
Downloading https://github.com/Medium/phantomjs/releases/download/v2.1.1/phantomjs-2.1.1-windows.zip
Saving to C:\Users\jkahl1\AppData\Local\Temp\phantomjs\phantomjs-2.1.1-windows.zip
Receiving...

Error making request.
Error: self signed certificate in certificate chain
at Error (native)
at TLSSocket. (_tls_wrap.js:1092:38)
at emitNone (events.js:86:13)
at TLSSocket.emit (events.js:185:7)
at TLSSocket._finishInit (_tls_wrap.js:610:8)
at TLSWrap.ssl.onhandshakedone (_tls_wrap.js:440:38)

Please report this full log at https://github.com/Medium/phantomjs
npm WARN optional SKIPPING OPTIONAL DEPENDENCY: [email protected] (node_modules\fsevents):
npm WARN notsup SKIPPING OPTIONAL DEPENDENCY: Unsupported platform for [email protected]: wanted {"os":"darwin","arch":"any"} (current: {"os":"win32","arch":"x64"})

npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! [email protected] install: node install.js
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the [email protected] install script.
npm ERR! This is probably not a problem with npm. There is likely additional logging output above.

npm ERR! A complete log of this run can be found in:
npm ERR! C:\Users\jkahl1\AppData\Roaming\npm-cache_logs\2017-08-23T13_58_46_334Z-debug.log

@ruiqiliu
Copy link

Adding PhantomJS to PATH manually solved this problem:
download PhantomJS manually, and unzip it, then add phantomjs.exe to the PATH env varibable.

@nhack
Copy link

nhack commented Oct 17, 2017

I'm having exactly the same issue, any luck solving it?

@JoeKahl
Copy link

JoeKahl commented Oct 17, 2017

My solution is to manually download the zip and place it in the location the script expects.
Just read the error message carefully to find the expected path.

@nhack
Copy link

nhack commented Oct 17, 2017

But the issue is really strange, because everything used to work fine, and suddenly the install.js script says phantomjs can't be found in the path, but phantomjs is there:

which phantomjs
-> /dev/node_modules/phantomjs/lib/phantom/bin/phantomjs

@manish-wedigtech
Copy link

PhantomJS not found on PATH
Downloading https://github.com/Medium/phantomjs/releases/download/v2.1.1/phantomjs-2.1.1-windows.zip
Saving to C:\Users\user01\AppData\Local\Temp\phantomjs\phantomjs-2.1.1-windows.zip

reinstall globally.

@dhruvdutt
Copy link

For Linux, just ran this script and it worked.

cd /usr/local/share
sudo wget https://bitbucket.org/ariya/phantomjs/downloads/phantomjs-2.1.1-linux-x86_64.tar.bz2
sudo tar xjf phantomjs-2.1.1-linux-x86_64.tar.bz2
sudo ln -s /usr/local/share/phantomjs-2.1.1-linux-x86_64/bin/phantomjs /usr/local/share/phantomjs
sudo ln -s /usr/local/share/phantomjs-2.1.1-linux-x86_64/bin/phantomjs /usr/local/bin/phantomjs
sudo ln -s /usr/local/share/phantomjs-2.1.1-linux-x86_64/bin/phantomjs /usr/bin/phantomjs

@klrmn
Copy link

klrmn commented May 1, 2018

now, granted, i also did @dhruvdutt 's global install of phantomjs, but that didn't fix it.
what fixed it was to define TMPDIR=/tmp before running install. the problem was that
process.env.TMPDIR was resolving to null rather than a string.

@woozhijun
Copy link

RUN PHANTOMJS_CDNURL=https://npm.taobao.org/mirrors/phantomjs/ npm install phantomjs-prebuilt

@doniz
Copy link

doniz commented Dec 10, 2018

For me helps to install bzip2 with yum install bzip2 on centos machine.

@prithvirajrmd2015
Copy link

Hi every i too got the same the crazy thing is my office network is blocking my connection to that repository... ;- )

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests