diff --git a/lib/resolve.js b/lib/resolve.js index 8ba6237..2bdeb9f 100644 --- a/lib/resolve.js +++ b/lib/resolve.js @@ -108,7 +108,7 @@ module.exports = function resolve(dirname) { // If the above didn't work, or this module is loaded globally, then // resort to require.main.filename (See http://nodejs.org/api/modules.html) if (alternateMethod || null == appRootPath) { - appRootPath = path.dirname(require.main.filename); + appRootPath = path.dirname(requireFunction.main.filename); } // Handle global bin/ directory edge-case