Node.js jsreport:Error Ocurred-呈现报告时出错

Node.js jsreport:Error Ocurred-呈现报告时出错,node.js,phantomjs,jsreport,Node.js,Phantomjs,Jsreport,我在mac上对nodejs使用jsreport,我得到以下错误 我已经修改了文件夹权限并以root用户身份运行,但它不起作用。示例代码直接从官方网站复制并粘贴了它 server.js var http = require('http'); var jsreport = require('jsreport'); http.createServer(function (req, res) { jsreport.render("<h1>Hello world</h1>"

我在mac上对nodejs使用jsreport,我得到以下错误

我已经修改了文件夹权限并以root用户身份运行,但它不起作用。示例代码直接从官方网站复制并粘贴了它

server.js

var http = require('http');
var jsreport = require('jsreport');

http.createServer(function (req, res) {

  jsreport.render("<h1>Hello world</h1>").then(function(out) {
    out.stream.pipe(res);
  }).catch(function(e) {    
    res.end(e.message);
  });

}).listen(1337, '127.0.0.1');

默认值phantomjs@1.9目前无法在macOS sierra更新上运行,您需要使用phantomjs 2

配方默认安装使用phantomjs@1.9. 您还可以安装其他版本并并行使用它们

  • 使用
    npm安装phantomjs-exact-2-1-1
  • 使用jsreport studio在属性中切换phantomjs版本,或在api调用中设置
    “template.phantom.phantomjsVersion”:“2.1.1”
  • 您还可以在配置中全局设置默认phantomjs版本:

    "phantom": {   
      "defaultPhantomjsVersion": "2.1.1"
    }
    
    请注意,PhantomJS2生成不同大小的字体。此外,它不支持在表生成多个页面时重复thead


    默认值phantomjs@1.9目前无法在macOS sierra更新上运行,您需要使用phantomjs 2

    配方默认安装使用phantomjs@1.9. 您还可以安装其他版本并并行使用它们

  • 使用
    npm安装phantomjs-exact-2-1-1
  • 使用jsreport studio在属性中切换phantomjs版本,或在api调用中设置
    “template.phantom.phantomjsVersion”:“2.1.1”
  • 您还可以在配置中全局设置默认phantomjs版本:

    "phantom": {   
      "defaultPhantomjsVersion": "2.1.1"
    }
    
    请注意,PhantomJS2生成不同大小的字体。此外,它不支持在表生成多个页面时重复thead