问题
Tried almost everything, ending up with removing all npm&node (and node modules) and installing again. same results:
CasperError: Can't find module fs
phantomjs://code/bootstrap.js:297 in patchedRequire
phantomjs://platform/colorizer.js:35
CasperError: Can't find module fs
phantomjs://code/bootstrap.js:297 in patchedRequire
phantomjs://platform/casper.js:36
TypeError: undefined is not a constructor (evaluating 'require('casper').create()')
phantomjs://code/cloner.js:1 in global code
:0 in injectJs
phantomjs://code/bootstrap.js:435
It will even happen just by placing
var casper = require("casper").create();
Any ideas guys?
(MacBook Air OSX El Capitan 10.11.6)
回答1:
Did you: var fs = require('fs');
?
Are casperjs and phamtomjs installed globally ?
来源:https://stackoverflow.com/questions/39508654/cant-get-casperjs-to-work-on-mac-osx