0
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;
    }
}

This is the code i currently have for a javascript program i am trying to use IsReachable as said here but the program keeps saying require is not recognised. Am i missing a certain import? i have installed everythin specified in the above URL. Thx for any help

Kashan
  • 348
  • 3
  • 19
Richard Teunen
  • 79
  • 1
  • 1
  • 5
  • Possible duplicate of [Javascript require() function giving ReferenceError: require is not defined](https://stackoverflow.com/questions/23603514/javascript-require-function-giving-referenceerror-require-is-not-defined) – Kashan Jan 12 '19 at 15:15
  • .....[the browser (with a bundler)](https://www.npmjs.com/package/is-reachable/v/3.0.0) You missed some dependencies – gaetanoM Jan 12 '19 at 15:18
  • @gaetanoM which dependancies am i missing? how do i find out which ones i am missing – Richard Teunen Jan 12 '19 at 15:47
  • Looks like you're running it directly in the browser. Or are you using any tools? How does the directory structure look like? – axm__ Jan 13 '19 at 16:34

0 Answers0