CasperJS: command not found

1,175 views
Skip to first unread message

Marco Ippolito

unread,
Sep 24, 2013, 11:11:20 AM9/24/13
to casp...@googlegroups.com
Hi everybody,

in my Ubuntu T1 AWS istance I downloaded and installed CasperJS 1.1
So in the main directory I have:
n1k0-casperjs-cd1fab5 directory 
casperjs (sym-linked from bin directory) 
and googlelinks.js (copied from example directory).
Typing casperjs googlelinks.js the result is:
casperjs: command not found

What am I missing? what do I have to do?

Thank you in advance for your help.
Kind regards
Marco

Andrew Hamilton

unread,
Sep 24, 2013, 5:16:44 PM9/24/13
to casp...@googlegroups.com
I'm wondering if you symlinked the directory. 

You have to run Casper from casperjs/bin/casperjs, so your best bet is to symlink the location of the actual executable into a directory always searched by your path:

ln -sf /path/to/casperjs/bin/casperjs /usr/local/bin/casperjs

You may also need to make it executable: 

chmod 755 /path/to/casperjs/bin/casperjs

Then it should work from anywhere!

Marco Ippolito

unread,
Sep 24, 2013, 6:24:06 PM9/24/13
to casp...@googlegroups.com
Hi Andrew,
thank you for giving me some help.
This is what I did:
sudo ln -sf ~/n1k0-casperjs-cd1fab5/bin/casperjs /usr/local/bin/casper js
chmod 755 ~/n1k0-casperjs-cd1fab5/bin/casperjs

But now it says:
"casperjs googlelinks.js
phantomjs: error while loading shared libraries: libfontconfig.so.1: cannot open shared object file: No such file or directory"
googling I found that this problem occurs when phantomjs is an older version than 1.6.0 (https://github.com/yeoman/yeoman/issues/446 )
So:
I uninstalled my PhantomJS from my package manager with sudo apt-get remove phantomjs
and then
I downloaded from here: http://phantomjs.org/download.html the latest (1.9.2) version of the binary code for Linux: https://phantomjs.googlecode.com/files/phantomjs-1.9.2-linux-x86_64.tar.bz2

I extracted the directory phantomjs-1.9.2-linux-x86_64 but the problem persists:  casperjs googlelinks.js
phantomjs: error while loading shared libraries: libfontconfig.so.1: cannot open shared object file: No such file or directory

What do I have to do next?

Thank you again
Kind regards
Marco




2013/9/24 Andrew Hamilton <and...@gripmedia.com>

--
CasperJS homepage & documentation: http://casperjs.org/
CasperJS @github: https://github.com/n1k0/casperjs
 
You received this message because you are subscribed to the Google Groups "casperjs" group.
Visit this group at http://groups.google.com/group/casperjs?hl=en.
---
You received this message because you are subscribed to a topic in the Google Groups "CasperJS" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/casperjs/E2MHiPeSfFM/unsubscribe.
To unsubscribe from this group and all its topics, send an email to casperjs+u...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.

Alon Nisser

unread,
Sep 25, 2013, 3:47:45 AM9/25/13
to casp...@googlegroups.com
is phantomjs on the path end executable? you can check by writing

```phantomjs --version``` on the command line, if the output is different than something like:```phantomjs bla bla version 1.9.X``` then the problem is phantomjs installation

Marco Ippolito

unread,
Sep 25, 2013, 4:12:31 AM9/25/13
to casp...@googlegroups.com
Hi Alon,
as Ariya rightly pointed out, phantomjs doesn't contain some libraries (FreeType,FontConfig), that must be installed in the system.

So I installed the missing library FontConfig, and now CasperJS seems working.

Thank you for your kind help.
Kind regards.
Marco


2013/9/25 Alon Nisser <alon...@gmail.com>
Reply all
Reply to author
Forward
0 new messages