{"id":417,"date":"2014-04-22T19:36:40","date_gmt":"2014-04-22T19:36:40","guid":{"rendered":"http:\/\/nikola-breznjak.com\/blog\/?p=417"},"modified":"2015-08-20T11:53:25","modified_gmt":"2015-08-20T11:53:25","slug":"installing-casperjs-on-rhel-linux-distribution","status":"publish","type":"post","link":"https:\/\/nikola-breznjak.com\/blog\/quick-tips\/installing-casperjs-on-rhel-linux-distribution\/","title":{"rendered":"Installing CasperJS on RHEL Linux distribution"},"content":{"rendered":"<p>First you have to install NodeJS. You can do that via\u00a0package manager <a href=\"https:\/\/github.com\/joyent\/node\/wiki\/Installing-Node.js-via-package-manager\">for your distribution<\/a>. In my case (RHEL) it is easily done with:<\/p>\n<pre class=\"lang:default decode:true\">sudo yum install nodejs npm --enablerepo=epel<\/pre>\n<p>Installing CasperJS is easy via npm (Node package manager):<\/p>\n<pre class=\"lang:default decode:true\">sudo npm install -g casperjs<\/pre>\n<p>You will get output similar to this:<\/p>\n<pre class=\"lang:default decode:true \">Copying extracted folder \/usr\/lib\/node_modules\/casperjs\/node_modules\/phantomjs\/phantomjs\/phantomjs-1.9.7-linux-x86_64.tar.bz2-extract-1396259124118\/phantomjs-1.9.7-linux-x86_64 -&gt; \/usr\/lib\/node_modules\/casperjs\/node_modules\/phantomjs\/lib\/phantom\r\nWriting location.js file\r\nDone. Phantomjs binary available at \/usr\/lib\/node_modules\/casperjs\/node_modules\/phantomjs\/lib\/phantom\/bin\/phantomjs\r\n\/usr\/bin\/casperjs -&gt; \/usr\/lib\/node_modules\/casperjs\/bin\/casperjs\r\nnpm WARN unmet dependency \/usr\/lib\/node_modules\/block-stream requires inherits@'~2.0.0' but will load\r\nnpm WARN unmet dependency undefined,\r\nnpm WARN unmet dependency which is version undefined\r\nnpm WARN unmet dependency \/usr\/lib\/node_modules\/fstream requires inherits@'~2.0.0' but will load\r\nnpm WARN unmet dependency undefined,\r\nnpm WARN unmet dependency which is version undefined\r\nnpm WARN unmet dependency \/usr\/lib\/node_modules\/fstream-ignore requires inherits@'2' but will load\r\nnpm WARN unmet dependency undefined,\r\nnpm WARN unmet dependency which is version undefined\r\nnpm WARN unmet dependency \/usr\/lib\/node_modules\/fstream-npm requires inherits@'2' but will load\r\nnpm WARN unmet dependency undefined,\r\nnpm WARN unmet dependency which is version undefined\r\nnpm WARN unmet dependency \/usr\/lib\/node_modules\/glob requires inherits@'2' but will load\r\nnpm WARN unmet dependency undefined,\r\nnpm WARN unmet dependency which is version undefined\r\nnpm WARN unmet dependency \/usr\/lib\/node_modules\/npmconf requires inherits@'~2.0.0' but will load\r\nnpm WARN unmet dependency undefined,\r\nnpm WARN unmet dependency which is version undefined\r\nnpm WARN unmet dependency \/usr\/lib\/node_modules\/tar requires inherits@'2' but will load\r\nnpm WARN unmet dependency undefined,\r\nnpm WARN unmet dependency which is version undefined\r\ncasperjs@1.1.0-beta3 \/usr\/lib\/node_modules\/casperjs\r\n\u00e2\u00e2\u00e2 phantomjs@1.9.7-1 (which@1.0.5, rimraf@2.2.6, kew@0.1.7, ncp@0.4.2, mkdirp@0.3.5, adm-zip@0.2.1, npmconf@0.0.24)\r\n[nikola@barca2.favorit.hr ~]$ casperjs\r\nFatal: [Errno 2] No such file or directory; did you install phantomjs?\r\n[nikola@barca2.favorit.hr ~]$ \/usr\/bin\/casperjs\r\nFatal: [Errno 2] No such file or directory; did you install phantomjs?\r\n[nikola@barca2.favorit.hr ~]$ \/usr\/lib\/node_modules\/casperjs\/node_modules\/phantomjs\/lib\/phantom\/bin\/phantomjs\r\nphantomjs&gt;\r\n[nikola@barca2.favorit.hr ~]$ \/usr\/lib\/node_modules\/casperjs\/node_modules\/phantomjs\/lib\/phantom\/bin\/phantomjs --version\r\n1.9.7<\/pre>\n<p>To have the binaries in my path every time I log in I added this alias to my .bashrc:<\/p>\n<pre class=\"lang:default decode:true\">alias phantomset=\"export PATH=$PATH:\/usr\/lib\/node_modules\/casperjs\/node_modules\/phantomjs\/lib\/phantom\/bin\/\"<\/pre>\n<p>and my .bash_profile looks like this:<\/p>\n<pre class=\"lang:default decode:true\"># User specific environment and startup programs\r\nPATH=$PATH:$HOME\/bin\r\nexport PATH\r\nphantomset<\/pre>\n","protected":false},"excerpt":{"rendered":"<p>First you have to install NodeJS. You can do that via\u00a0package manager for your distribution. In my case (RHEL) it is easily done with: sudo yum install nodejs&hellip;<\/p>\n","protected":false},"author":1,"featured_media":471,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[25,15],"tags":[30],"class_list":["post-417","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-linux","category-quick-tips","tag-cas"],"_links":{"self":[{"href":"https:\/\/nikola-breznjak.com\/blog\/wp-json\/wp\/v2\/posts\/417","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/nikola-breznjak.com\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/nikola-breznjak.com\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/nikola-breznjak.com\/blog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/nikola-breznjak.com\/blog\/wp-json\/wp\/v2\/comments?post=417"}],"version-history":[{"count":2,"href":"https:\/\/nikola-breznjak.com\/blog\/wp-json\/wp\/v2\/posts\/417\/revisions"}],"predecessor-version":[{"id":2135,"href":"https:\/\/nikola-breznjak.com\/blog\/wp-json\/wp\/v2\/posts\/417\/revisions\/2135"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/nikola-breznjak.com\/blog\/wp-json\/wp\/v2\/media\/471"}],"wp:attachment":[{"href":"https:\/\/nikola-breznjak.com\/blog\/wp-json\/wp\/v2\/media?parent=417"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/nikola-breznjak.com\/blog\/wp-json\/wp\/v2\/categories?post=417"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/nikola-breznjak.com\/blog\/wp-json\/wp\/v2\/tags?post=417"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}