diff --git a/lib/repl.js b/lib/repl.js index c258bb03e1..447192e950 100644 --- a/lib/repl.js +++ b/lib/repl.js @@ -36,6 +36,9 @@ if (process.platform != 'win32') { // hack for require.resolve("./relative") to work properly. module.filename = process.cwd() + '/repl'; +// hack for repl require to work properly with node_modules folders +module.paths = require('module')._nodeModulePaths(module.filename); + function resetContext() { context = vm.createContext();