You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
relative module paths resolve differently in REPL. #5684
@phillipj the test is different. There is already a test-repl-require so I just bootstrapped on that.
Your test might be good to have as well, but the one I used is running in the repl itself. I'm going to push it to a fork, might make sense for you to cherry pick and add to your PR... I'll post it in there
Activity
benjamingr commentedon Mar 13, 2016
@jdalton thanks for the report!
Operating system?
Locally - On 5.1.0 I see:
Updating to 5.8 I get:
So assuming it didn't break between 5.1 and 5.8 I suspect it might be OS related.
jdalton commentedon Mar 13, 2016
@benjamingr
OSX 10.11.3
The issue is
require('./lodash')didn't work. You're doingrequire('./lodash.js').benjamingr commentedon Mar 13, 2016
Oh sorry, my bad. I see
4.6.1and not'should be me'too for that on windows.jdalton commentedon Mar 13, 2016
Cool, so it repros on Windows and OSX.
benjamingr commentedon Mar 13, 2016
Since
_resolveLookupPathsreturns:Which finds lodash if I do:
Which happens because of "hacky" code (terminology used) in repl.js. I have to leave now, but I'm at
node/lib/module.js
Lines 263 to 264 in 7c60328
.and not above.I'll keep debugging later - anyone feel free to pick this up.
watilde commentedon Mar 13, 2016
to place the node_modules paths below the
.and not above, the part of the _resolveLookupPaths should be like the following?MylesBorins commentedon Mar 13, 2016
I think I have a working test... going to see if this fix makes things work
phillipj commentedon Mar 13, 2016
@thealphanerd anything near what I've done in #5689?
MylesBorins commentedon Mar 13, 2016
@phillipj the test is different. There is already a
test-repl-requireso I just bootstrapped on that.Your test might be good to have as well, but the one I used is running in the repl itself. I'm going to push it to a fork, might make sense for you to cherry pick and add to your PR... I'll post it in there
module: prioritize current dir for local lookups
module: prioritize current dir for local lookups