I wrote an web scraping script with CasperJS and it works perfectly on Mac OS 10.10.4 with CasperJS version 1.1.0-beta3 and PhantomJS version 1.9.8, but when I put the same script on one of my servers which is Ubuntu 14.04 (running inside Docker container) with the same environment (CasperJS and PhantomJS all the same versions) it suddenly just outputs this:
I'm `fs` modules
Which is pretty strange. One of my suggestion is that in this script I am also trying to require some other scripts with require like that:
var parsingStrategy = require(strategiesPath + strategyName);
and the path to those strategies is correct I already checked that. All the other stuff that I'm doing in this script are just normal CasperJS stuff which are documented and work well I think.
Okay guys I have an answer for you - the 'fs' is a module bundled with node, so it doesn't have to be installed through npm. The package you downloaded is this: https://www.npmjs.com/package/fs and all it contains is...
console.log("I'm `fs` modules");
When you did:
npm uninstall fs
npm install -g fs
The node used its local package - that it shipped with - and ignored the global one entirely. Mystery solved. ;)
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With