function packageExists(packageName) {
    try {
        require(packageName);
        return true;
    } catch (err) {
        return false;
    }
}

module.exports = packageExists;

@@ -56,16 +56,24 @@
  require
+.resolve
 (package

improve package-exists util (#2067)