[错误:PhantomJS退出并返回值为127]

时间:2015-07-28 05:18:03

标签: node.js meteor phantomjs

我有以下代码生成我的网站的webshot。它适用于我的本地计算机(Windows环境),但在测试服务器上是linux,我退出PhantomJS返回值为127.这个错误意味着什么,我该如何解决?

webshot(url, fileName, options, function(err) {

        if(!err){

                    fs.readFile(fileName, function (err,data) {
                        if (err) {
                            console.log(fileName);
                          return console.log(err);
                        }
                        fs.unlinkSync(fileName);
                        fut.return(data);
                    });

                }else{
                    console.log(url);
                    console.log(err);
                    fut.return("Error Occurred");                    
                }


            });

3 个答案:

答案 0 :(得分:0)

Phantomjs was not installed on the linux server. Installation solved my issue.

答案 1 :(得分:0)

对我来说,问题是我需要安装一个额外的库,即fontconfig。

来源信息:http://phantomjs.org/download.html

答案 2 :(得分:0)

我在Debian中遇到了同样的问题。使用“ apt-get install phantomjs”安装Phantom解决了该问题。