按官方教程安装了casperjs,但在使用时提示模块不存在:
********\phantomjs>phantomjs app.js
Error: Cannot find module 'casper'
app.js
中的代码如下:
var casper = require('casper');
哪位大侠知道这是什么回事。
安装 casperjs 过程如下:
从官方下载 并把文件放在 C:\node\casperjs
目录中,并配置Path环境变量 C:\node\casperjs\bin;
官方给的教程如下:
CasperJS on Windows Phantomjs installation additions
Append ;C:\phantomjs
to your PATH environment variable.
Modify this path appropriately if you installed PhantomJS to a different location.
Casperjs installation additions
New in version 1.1-beta3.
Append ;C:\casperjs\bin
to your PATH environment variable.
Modify this path appropriately if you installed CasperJS to a different location.
You can now run any regular casper scripts that way:
C:> casperjs myscript.js
Colorized output
Note
New in version 1.1-beta1.
Windows users will get colorized output if ansicon is installed.