diff --git a/lib/inquire/index.js b/lib/inquire/index.js index 259011b17..5dd720bf7 100644 --- a/lib/inquire/index.js +++ b/lib/inquire/index.js @@ -8,12 +8,17 @@ module.exports = inquire; * @returns {?Object} Required module if available and not empty, otherwise `null` */ function inquire(moduleName) { - try { - var mod = eval("quire".replace(/^/,"re"))(moduleName); // eslint-disable-line no-eval - if (mod && (mod.length || Object.keys(mod).length)) - return mod; - } catch (e) {} // eslint-disable-line no-empty + try { + if (typeof require !== "function") { + return null; + } + var mod = require(moduleName); + if (mod && (mod.length || Object.keys(mod).length)) return mod; return null; + } catch (err) { + // ignore + return null; + } } /*