Casperjs error - invalid syntax error - centos

I recently installed Casperjs on server (centos) and when I try to run I get the following error:
File "/usr/local/bin/casperjs", line 11
except subprocess.CalledProcessError as err:
^
SyntaxError: invalid syntax
This is the result of running "casperjs --version" which should just print the version number. Although any other commands with casperjs also give the same output.
The steps that I followed to install are pretty standard:
git clone git://github.com/n1k0/casperjs.git
cd casperjs
git checkout tags/1.0.2
ln -sf `pwd`/bin/casperjs /usr/local/bin/casperjs
Also, I'm running version 1.9.6 of phantomjs which is required for casperjs.
Any ideas?

You could check if the version of python is greater than 2.6 or not
for my case , I type the command
python -v
and I get 2.4.3 on the old online redhat machine .
than you could try update your python version .
It might some help

Related

libxkbcommon.so.0: no version information available after installing VSCode update

I am using Ubuntu 14.04 LTS. After updating VSCode to v.1.53.0 I am getting following message on opening VSCode:
/usr/share/code/bin/../code: /usr/lib/x86_64-linux-gnu/libxkbcommon.so.0: no version information available (required by /usr/share/code/bin/../code)
On giving command code --verbose I get following logs: logs
I cannot update current Ubuntu version due to limited admin rights.
If you run code --verbose you will see real problem:
[main 2021-04-16T11:44:45.671Z] Main->SharedProcess#connect
/usr/share/code/code --verbose --no-sandbox: relocation error: /usr/share/code/resources/app/node_modules.asar.unpacked/spdlog/build/Release/spdlog.node: symbol _ZNKSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEE7compareEPKc, version GLIBCXX_3.4.21 not defined in file libstdc++.so.6 with link time reference
It can't find symbol basic_string::compare
echo _ZNKSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEE7compareEPKc | demangle
So to run visual studio code on Ubuntu 14.04 LTS
You just need to copy libstdc++.so.6.0.28 and libstdc++.so.6
to /usr/share/code from ubuntu 20.04 LTS
You can get libstdc++.so.6.0.28 (md5=0e7d34a60136c0cd150917ed099980f2) for example from this deb file
Here simple script to do it for you
#!/bin/sh
wget https://mirrors.wikimedia.org/ubuntu/ubuntu/pool/main/g/gcc-10/libstdc%2B%2B6_10.2.0-5ubuntu1~20.04_amd64.deb
dpkg-deb -R libstdc++6_10.2.0-5ubuntu1~20.04_amd64.deb .
sudo cp -P usr/lib/x86_64-linux-gnu/* /usr/share/code/
file version changed in wikimedia.org so new script:
#!/bin/sh
wget https://mirrors.wikimedia.org/ubuntu/ubuntu/pool/main/g/gcc-10/libstdc%2B%2B6_10.3.0-1ubuntu1~20.04_amd64.deb --no-check-certificate
dpkg-deb -R libstdc++6_10.3.0-1ubuntu1~20.04_amd64.deb .
sudo cp -P usr/lib/x86_64-linux-gnu/* /usr/share/code/
md5sum of new libstdc++.so.6.0.28 604ec2999aeb3aadd0e96103fd4b5e5d
Then just type code
ps: very good font for vscode JetBrains Mono
I downgraded my VSCode to lower version. Apparently you can access previous versions of VSCode from it's website but the link's font was too big form me to see.
Still if someone does come across any other alternative please share.
Leaving this here for others.

update perl dancer framework resulting in error message

Following this tutorial "https://perlmaven.com/getting-started-with-perl-dancer"
On Windows command line, I run the command "cpanm --verbose Dancer" and that resulted in error "Failed to download http://search.cpan.org/CPAN/authors/id/B/BI/BIGPRESH/Dancer-1.3202.tar.gz"
Playing with it I found the old dancer version is no longer work/available. So I ran
"cpanm --verbose Dancer2"
and that works! with version 2 of dancer.

MongoDB php7 driver installation

I'm working on an Ubuntu 16 server and I can't seem to get the mongodb driver for php 7 to work. I installed it successfully on my xampp on my windows machine but Ubuntu and php7 seemingly have vast differences.
I did try to install it via pecl install mongodb and used composer to put in the dependencies but it still does not work. I'm using the same php file from my windows Xampp and when I access the page it throws a 500 status code.
Could someone provide a definitive walkthrough on how to install this driver and maybe also how to revert any changes I made using composer and pecl?
Cool even I tried with pecl but didn't work as expected. It work with pecl7 Also, I received this warning along with error, WARNING: "pecl/mongo" is deprecated in favor of "channel:///mongodb" pecl/mongo requires PHP (version >= 5.3.0, version <= 5.99.99), installed version is 7.1.8. Also, got 500 Internal server error.
Before that MongoDB php7 driver, I needed the memcache and getting phphize error that I solved using this repo. Then finally I use this low level PHP driver for MongoDB.
$ git clone https://github.com/mongodb/mongo-php-driver.git
$ cd mongo-php-driver
$ git submodule sync && git submodule update --init
$ /usr/bin/phpize
$ ./configure
$ make all -j 5
$ sudo make install
You can confirm from the output that mongodb.so driver is installed.
;;;;;;;;;;;;;;;;;;;
; Module Settings ;
;;;;;;;;;;;;;;;;;;;
extension=mongodb.so
Then only step remaining is make it available in your respective path. You can check your extensions_dir in php.ini with the following command,
$ php -i | grep extension_dir
extension_dir => /usr/lib64/php/7.0/modules => /usr/lib64/php/7.0/modules
And, I can verify that mongodb.so is present into the above directory. Then reload the composer and you are good to go ! Hope this helps as it work for me.

ruby Fail to load readline

I intend to use Tab Completion, then I try to load readline using the following command:
$ irb -r irb/completion
However, irb throws an error message shown below:
/usr/local/lib/ruby/1.9.1/rubygems/custom_require.rb:36:in `require':LoadError: cannot load such file -- readline
Then I try to install readline using command:
gem install readline
But, RubyGems prompt me that
ERROR: Could not find a valid gem 'readline' (>= 0) in any repository
How can I fix it?
You have been troubled by the naming.
The repo name is rb-readline
You need to have the readline libraries installed when you compile Ruby.
Follow this blog: http://vvv.tobiassjosten.net/ruby-on-rails/fixing-readline-for-the-ruby-on-rails-console/

Invalid Syntax - easy_install with https://

I am using IPython.
I am attempting to install a package from GitHub.
I am using the following:
easy_install https://github.com/lisa-lab/pylearn2/tree/master/pylearn2
My output states invalid syntax (highlights the "s" in https).
Specifically it states File "<ipython-input-1-c700863fa141>", line 1
Any help would be appreciated.
There are a couple of misunderstandings here:
easy_install is not a Python command, it is a shell command. So you want to either run this line in a regular shell:
$> easy_install [url]
or prefix with ! in IPython:
In [1]: !easy_install [url]
that URL is not the right one for installing current master of a github project. You want to use the tarball url:
$> easy_install https://github.com/lisa-lab/pylearn2/tarball/master