Javascript ISReachable无法正常工作。说要求未定义

时间:2019-01-12 15:09:51

标签: javascript web

const PREFIX = "10.100.";
const MACHINES =    ["11.1","11.2","11.3","21.1","21.2","21.3","31.1","31.2","31.3","41.1","41.2","41.3","51.1","51.2","51.3"];
const isReachable = require('is-reachable');
for (const item of MACHINES) {
    const IP = PREFIX + item;
    if (!(await isReachable(IP))) {
        warn("Unable to reach " + IP);
        continue;
    }
}

这是我目前正在尝试使用IsReachable的javascript程序的代码,如here所示,但该程序一直在说无法识别require。我想念某种进口商品吗?我已经安装了上述网址中指定的所有内容。寻求帮助

0 个答案:

没有答案