Reputation: 41
So I'm trying to install phantom.js whilst at work. I can download the sourcecode for it and even have the .exe installed for it (so i can access the phantom shell). But its still not installed. When I try node ./install .js or npm install phantom.js I get this error.
connect ETIMEDOUT ip:port
This is most likely not a problem with npm itself
and is related to network connectivity.
In most cases you are behind a proxy or have bad network settings.
If you are behind a proxy, please make sure that the
'proxy' config is set properly. See: 'npm help config'
or
Receiving...
Error making request.
Error: connect ETIMEDOUT ipaddress:port
at Object.exports._errnoException (util.js:860:11)
at exports._exceptionWithHostPort (util.js:883:20)
at TCPConnectWrap.afterConnect [as oncomplete] (net.js:1063:14)
My node version is v4.4.2 and I'm on Windows 7.
I've tried editing my .npmrc file (the one which contains my proxy information) so that it now has the line phantomjs_cdnurl=https://cnpmjs.org/downloads
I've also tried adding bot the .exe file to my PATH and the sourcecode and still no luck. Finally, I've tried things the README suggests such as shell commands like "npm install phantomjs-prebuilt --phantomjs_cdnurl=https://bitbucket.org/ariya/phantomjs/downloads" but has the same errors as well. Is there something I'm missing/done wrong? help would be GREATLY appreciated.
Upvotes: 1
Views: 1914
Reputation: 41
I found the best thing to do which worked like a charm was to use phantomjs-that-works
npm install -g phantomjs-that-works
Upvotes: 1
Reputation: 16838
The simplest solution here is to correctly add PhantomJS folder to PATH environment variable. For example if initially you have such PATH:
C:\Perl\bin;C:\Windows\system32;C:\Windows;C:\Windows\System32\Wbem;C:\Windows\System32\WindowsPowerShell\v1.0\;C:\Python27\;C:\Python27\Scripts;C:\Program Files\TortoiseHg\
then you add a semicolon and the path to the folder where PhantomJS resides, not to .exe itself. So it hypothetically PhantomJS is at C:\Phantomjs\phantom.exe
you only add ;C:\Phantomjs\
:
C:\Perl\bin;C:\Windows\system32;C:\Windows;C:\Windows\System32\Wbem;C:\Windows\System32\WindowsPowerShell\v1.0\;C:\Python27\;C:\Python27\Scripts;C:\Program Files\TortoiseHg\;C:\Phantomjs\
Then you press OK, then you close the command prompt and open it again so that it reads the updated PATH. After that you're free to use phantomjs by calling it by name phantom
(if it's called phantom.exe
) anywhere.
Upvotes: 0