我正在运行一个简单的clamscan 示例。
const NodeClam = require('clamscan');
let options = {
debug_mode: true,
// clamdscan: {
// socket: '/var/run/clamav/clamd.ctl', // This is pretty typical
// host: '127.0.0.1', // If you want to connect locally but not through socket
// port: 3310, // Because, why not
// timeout: 300000, // 5 minutes
// local_fallback: true, // Use local preferred binary to scan if socket/tcp fails
// path: '/usr/bin/clamdscan', // Special path to the clamdscan binary on your server
// config_file: '/etc/clamav/clamd.conf', // A fairly typical config location
// multiscan: false, // You hate speed and multi-threaded awesome-sauce
// reload_db: true, // You want your scans to run slow like with clamscan
// active: false, // you don't want to use this at all because it's evil
// bypass_test: true, // Don't check to see if socket is available. You should probably never set this to true.
// },
preference: 'clamscan'
};
async function some_function() {
try {
// Get instance by resolving ClamScan promise object
console.log("-------------------hello world------------------------------");
const clamscan = await new NodeClam().init(options);
//console.log(clamscan);
console.log("--------------------------------------------------------hello world------------------------------------------------");
const {good_files, bad_files} = await clamscan.scan_dir('/home/abhishek/Desktop/JSINFO', );
console.log("----------------------------------------------------------hello world--------------------------------------------------------------------");
console.log(good_files);
} catch (err) {
console.log(err);
}
};
some_function();
但是,我收到这样的错误:
节点蛤:标准输出:节点蛤:<未知文件路径!>被感染!(节点:109042)UnhandledPromiseRejectionWarning:错误:错误:产生 /usr/bin/clamscan --no-summary --stdout。
在位置 /usr/bin/clamscan 中有一个 clamscan 文件。但这仍然来了