微信公众号搜"智元新知"关注
微信扫一扫可直接关注哦!

从 mht 文件中提取文件时出现 Mhtml 库错误

如何解决从 mht 文件中提取文件时出现 Mhtml 库错误

我需要提取图像并生成一个 html 文件。 我已经安装了站点中提到的 mhtml 库

package.json file 

 "dependencies": {
    "mhtml": "^0.1.2"
  }

我使用了与 npm 站点中提到的相同的演示代码

var mhtml = require('mhtml');

mhtml.extract('C:\\Projects\\DEMO\\mhtmlDemo/Template.mht','C:\\Projects\\DEMO\\mhtmlDemo',function (err) {    
  console.log('done.');
});

我遇到了附加的错误

Error Screenshot

这里的错误文件是mhtml库的一部分,cheerio-select在安装mhtml库时作为node-modules的一部分出现。

var _ = require('underscore'),select = require('cheerio-select'),utils = require('../utils'),isTag = utils.isTag;

var find = exports.find = function(selector) {
  // Todo: Remove the call to _.uniq when the underlying bug in CSSselect has
  // been resolved:
  // https://github.com/fb55/CSSselect/issues/12
  return this.make(_.uniq(select(selector,[].slice.call(this.children()))));
};

有没有人遇到过上述问题并且可以建议如何解决这个问题。

我尝试清除 node_modules 并重新安装,但是没有用。

版权声明:本文内容由互联网用户自发贡献,该文观点与技术仅代表作者本人。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌侵权/违法违规的内容, 请发送邮件至 dio@foxmail.com 举报,一经查实,本站将立刻删除。