-1
Ich benutze die Bibliothek Broken-Link-Checker in meiner Node App, um nach defekten Links zu suchen. Ich erhalte diesen Fehler:Knoten js App mit Optionen ist nicht definiert
var htmlChecker = new blc.HtmlChecker(options, {
^
ReferenceError: options is not defined
at Object.<anonymous> (D:\nodejs\app.js:28:39)
at Module._compile (module.js:570:32)
at Object.Module._extensions..js (module.js:579:10)
at Module.load (module.js:487:32)
at tryModuleLoad (module.js:446:12)
at Function.Module._load (module.js:438:3)
at Module.runMain (module.js:604:10)
at run (bootstrap_node.js:390:7)
at startup (bootstrap_node.js:150:9)
at bootstrap_node.js:505:3
Das folgende ist mein Code für die Knoten-App.
var blc = require('broken-link-checker');
var htmlChecker = new blc.HtmlChecker(options, {
html: function(tree, robots){},
junk: function(result){},
link: function(result){},
complete: function(){}
});
var html = "http://specflux.com";
var baseUrl = "http://specflux.com";
htmlChecker.scan(html, baseUrl);
Dies ist das NPM-Paket Link: https://www.npmjs.com/package/broken-link-checker
die variablen Optionen nicht in Ihrem Code definiert ist. –