简体   繁体   English

节点使用 html-pdf npm 返回 SIGSEGV 错误

[英]Node returns SIGSEGV error with html-pdf npm

var fs = require('fs');
var pdf = require('html-pdf');
var html = '<html><body><div>hi testing</div></body></html>'
var options = { format: 'Letter' };

pdf.create(html, options).toFile('./businesscard.pdf', function(err, res) {
  if (err) return console.log(err);
  console.log(res);
});

I am using this code to convert html to pdf using html-pdf.我正在使用此代码使用 html-pdf 将 html 转换为 pdf。 But I am continuously getting the same error但我不断收到同样的错误

SIGSEGV

I am using the same code from long time.我很长一段时间都在使用相同的代码。 But suddenly from last few days, I started facing this error.但是突然从最近几天开始,我开始面临这个错误。

Node - v8.6.2
Npm - v6.4.1
html-pdf - v2.2.0

A SIGSEGV is an error(signal) caused by an invalid memory reference or a segmentation fault. SIGSEGV 是由无效内存引用或分段错误引起的错误(信号)。
segfault-handler module which catches segfaults on non-Windows platforms and generates a stack trace. segfault-handler模块,它在非 Windows 平台上捕获段错误并生成堆栈跟踪。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM