Node.js jsreport:Error Ocurred-呈现报告时出错
我在mac上对nodejs使用jsreport,我得到以下错误 我已经修改了文件夹权限并以root用户身份运行,但它不起作用。示例代码直接从官方网站复制并粘贴了它 server.jsNode.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>"
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
“template.phantom.phantomjsVersion”:“2.1.1”
"phantom": {
"defaultPhantomjsVersion": "2.1.1"
}
请注意,PhantomJS2生成不同大小的字体。此外,它不支持在表生成多个页面时重复thead
默认值phantomjs@1.9目前无法在macOS sierra更新上运行,您需要使用phantomjs 2 配方默认安装使用phantomjs@1.9. 您还可以安装其他版本并并行使用它们
npm安装phantomjs-exact-2-1-1
“template.phantom.phantomjsVersion”:“2.1.1”
"phantom": {
"defaultPhantomjsVersion": "2.1.1"
}
请注意,PhantomJS2生成不同大小的字体。此外,它不支持在表生成多个页面时重复thead