Skip to content

repl: fix require('3rdparty') regression

Rodrigo Muino Tomonari requested to merge github/fork/bnoordhuis/fix4208 into master

Fix module loading of third-party modules in the REPL by inheriting module.paths from the REPL's parent module.

Commit ee72ee75 ("module,repl: remove repl require() hack") introduced a regression where require() of modules in node_modules directories no longer worked in the REPL (and fortunately only in the REPL.) It turns out we didn't have test coverage for that but we do now.

Fixes: https://github.com/nodejs/node/issues/4208

R=@silverwind?

CI: https://ci.nodejs.org/job/node-test-pull-request/969/

Merge request reports

Loading