Skip to content

module: the node_modules paths always should be placed below the current directory

Rodrigo Muino Tomonari requested to merge github/fork/watilde/patch-module into master

Pull Request check-list

Please make sure to review and check all of these items:

  • Does make -j8 test (UNIX) or vcbuild test nosign (Windows) pass with this change (including linting)?
  • Is the commit message formatted according to CONTRIBUTING.md?
  • If this change fixes a bug (or a performance problem), is a regression test (or a benchmark) included?
  • Is a documentation update included (if this change modifies existing APIs, or introduces new ones)?

NOTE: these things are not required to open a PR and can be done afterwards / while the PR is open.

Affected core subsystem(s)

repl

Description of change

Fix #5684 (closed). The result of the require("module")._resolveLookupPaths('./') in repl

Before:

[ './',
  [ '/Users/watilde/Development/tmp/repro/node_modules',
    '/Users/watilde/Development/tmp/node_modules',
    '/Users/watilde/Development/node_modules',
    '/Users/watilde/node_modules',
    '/Users/node_modules',
    '/node_modules',
    '.',
    '/Users/watilde/.node_modules',
    '/Users/watilde/.node_libraries',
    '/Users/watilde/.nodebrew/node/v5.4.0/lib/node' ] ]

After:

[ './',
  [ '/Users/watilde/Development/tmp/repro',
    '/Users/watilde/Development/tmp/repro/node_modules',
    '/Users/watilde/Development/tmp/node_modules',
    '/Users/watilde/Development/node_modules',
    '/Users/watilde/node_modules',
    '/Users/node_modules',
    '/node_modules',
    '/Users/watilde/.node_modules',
    '/Users/watilde/.node_libraries',
    '/Users/watilde/Development/node/out/lib/node' ] ]

will update test/parallel/test-repl.js

Merge request reports

Loading