【问题标题】:Node returns SIGSEGV error with html-pdf npm节点使用 html-pdf npm 返回 SIGSEGV 错误
【发布时间】:2020-04-16 14:29:54
【问题描述】:
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);
});

我正在使用此代码使用 html-pdf 将 html 转换为 pdf。但我不断收到同样的错误

SIGSEGV

我长期以来一直在使用相同的代码。但是突然从最近几天开始,我开始遇到这个错误。

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

【问题讨论】:

    标签: node.js npm html-pdf


    【解决方案1】:

    SIGSEGV 是由无效的内存引用或分段错误引起的错误(信号)。
    segfault-handler 模块在非 Windows 平台上捕获段错误并生成堆栈跟踪。

    【讨论】:

      猜你喜欢
      • 2018-02-17
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2012-06-15
      • 2020-12-04
      相关资源
      最近更新 更多