casperjs 的安装问题
发布于 10 年前 作者 iln168 8375 次浏览 最后一次编辑是 8 年前

按官方教程安装了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;

5 回复

我的系统是windows 8的

官方给的教程如下:

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.

哪位大湿知道这早什么情况

有人知道吗

有谁知道

回到顶部