几乎尝试了一切,最终删除了所有npm&节点(和节点模块)并再次安装。相同的结果:
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
甚至可以通过放置
来实现 var casper = require("casper").create();
任何想法的人?
(MacBook Air OSX El Capitan 10.11.6)
答案 0 :(得分:0)
你有没有:var fs = require('fs');
?
是否全局安装了casperjs和phamtomj?