Quantcast
Channel: CNode:Node.js专业中文社区
Viewing all articles
Browse latest Browse all 14821

nodejs调用phantomjs时,phantomjs.path为null,应该要怎么处理?

$
0
0

var path = require(‘path’); var childProcess = require(‘child_process’); var Q = require(‘q’); var phantomjs = require(‘phantomjs’); var binPath = phantomjs.path;… childProcess.execFile(binPath, childArgs, function (err, stdout, stderr) { console.log(stdout); console.log(stderr);

// handle results
deferred.resolve();

}); 这段代码中binPath,也就是phantomjs.path是空的,线上服务器的phantomjs通过npm安装了,但是就是为null,完全不知道怎么办。因为我是搞java的,公司这个是之前遗留的系统,现在一脸懵逼求各位大神帮忙下,感激不尽!!!


Viewing all articles
Browse latest Browse all 14821

Trending Articles