cant get CasperJS to work on Mac OSX

孤者浪人 提交于 2019-12-11 05:53:34

问题


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

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!