I can't get casperjs to work on mac,

98 views
Skip to first unread message

jai P

unread,
Feb 24, 2017, 3:56:16 PM2/24/17
to CasperJS
± casperjs main.js
CasperError: Can't find module fs

  phantomjs://code/bootstrap.js:297 in patchedRequire
^C


± casperjs --version
1.1.3

± phantomjs --version
2.1.1

 
Here's my main.js  File. 


var fs = require('fs');
console.log ( ' fs =', fs); 
var casper = require('casper').create();
console.log( ' hello from main.js');
casper.exit();



Screen Shot 2017-02-24 at 3.53.39 PM.png

Jason Goyer

unread,
Mar 21, 2017, 5:42:31 PM3/21/17
to CasperJS
I had issues running casperjs on mac too. It turned out to be an issue with python. I unset my pythonhome and pythonpath variables and it fixed the issue. See if python runs for you.

Ken

unread,
May 25, 2017, 9:40:36 AM5/25/17
to CasperJS
Think saw this issue on CasperJS issues page. Can consider uninstall fs module from npm. There seems to be some conflict going on. Also, CasperJS isn't a Node.js module, it is more for distribution and packaging purpose so not meant to work 100%.
Reply all
Reply to author
Forward
0 new messages