Well, it's hard to diagnose accurately, but I tried my code with the following fixes for inconsistent quotes, and it seems to work fine on v0.10.6. These two lines look like this:
var filename="temp.jpg';
you need to fix it first.
My best guess is that you have a 32-bit and 64-bit problem ... seeing how you switch machines and it fails or works. Therefore, I simulated that by installing a 32-bit node on a 64-bit system to show the troubleshooting procedure for this kind of thing:
First check the exit code:
[ node@hip1 blah]$ phantomjs [ node@hip1 blah]$ $? -bash: 127: command not found
follow all the symbolic links and run the executable file directly, for example, on my system:
[ node@hip1 blah]$ which phantomjs ~/node/bin/phantomjs [ node@hip1 blah]$ ls -l ~/node/bin/phantomjs lrwxrwxrwx. 1 node node 43 Jun 16 20:06 /node/node/bin/phantomjs -> ../lib/node_modules/phantomjs/bin/phantomjs [ node@hip1 blah]$ ls -l /node/node/lib/node_modules/phantomjs/bin/phantomjs -rwxr-xr-x. 1 node node 540 Jun 16 20:14 /node/node/lib/node_modules/phantomjs/bin/phantomjs
accomplish this ...
[ node@hip1 blah]$ /node/node/lib/node_modules/phantomjs/bin/phantomjs /node/libs/node-v0.10.6-linux-x86/lib/node_modules/phantomjs/lib/phantom/bin/phantomjs: error while loading shared libraries: libfreetype.so.6: cannot open shared object file: No such file or directory
And, pay attention to the .6 at the end of this library, that it is a 64-bit system, but we installed a 32-bit node to avoid memory problems, and also noted the best performance with it. So npm install phantomjs goes and gets a 32 bit version of this. So now I need the Debian i686 versions of these libraries that will not be installed unless I specify - I will get x86_64 versions instead. So do a few of them:
yum install freetype-devel.i686 or when using debian apt-get install . You may also need libfontconfig.so.1, which is located in fontconfig-devel.i686.
And finally!
phantomjs>
After that, everything should work.