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. ;)
I had the same problem. My OS is window 7 but I don't think that OS is the problem.
This is what I did and it worked
npm uninstall fs
npm install -g fs
I don't know why this happened but it's fixed now.
This is not an error, it's a console.log
message. This module may exist for universal JS purposes (fs doesn't apply to browser so you could remap an import in browser environment to this no-op package with browserify / webpack and not have your code crash). If that is the case, the message should say a bit clearer.
It may also have been published as a stop word for the fs package since it could be a potential exploit if someone were to publish a package with ill intent praying on users accidentally installing and running it instead of the built-in fs
module.