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
Can throw ENOTDIR instead of MODULE_NOT_FOUND #121
My setup was just in the root of the Babel repo, in this case with CHANGELOG.md being a file in the current directory. Should reproduce in a empty dir with
@loganfsmyth could you give this branch a try? It includes both a fix, and a (hopefully insignificant) breaking change, which should bring resolve in line with require.resolve for these kinds of scenarios.
Activity
ljharb commentedon Mar 12, 2017
The comparison would be to
require.resolve, not torequire, but I suspect that's a red herring.What filesystem setup and
resolveversion are you gettingENOTDIRwith? I can't reproduce it - everything gives meMODULE_NOT_FOUND.loganfsmyth commentedon Mar 12, 2017
Right, true enough about the example.
My setup was just in the root of the Babel repo, in this case with
CHANGELOG.mdbeing a file in the current directory. Should reproduce in a empty dir withljharb commentedon Mar 12, 2017
Thanks, with a filename that exists, I get the following:
require.resolve, in both cases, givesMODULE_NOT_FOUND.The former is a bug, the latter is a deviation (arguably a more useful variant) - but since
require.resolvedoesn't do that, we shouldn't either.ljharb commentedon Mar 12, 2017
Of note, this seems to only happen when the
basediroption is not provided.loganfsmyth commentedon Mar 12, 2017
I first ran across it when using a
basedir, but it appears to happen with or without for me.[Fix] error code MODULE_NOT_FOUND instead of ENOTDIR
ljharb commentedon Mar 19, 2017
@loganfsmyth could you give this branch a try? It includes both a fix, and a (hopefully insignificant) breaking change, which should bring
resolvein line withrequire.resolvefor these kinds of scenarios.loganfsmyth commentedon Apr 4, 2017
Looks good to me, thanks! Sorry it took so long to get back to this.
ljharb commentedon Apr 5, 2017
@loganfsmyth thanks!
[Fix] error code MODULE_NOT_FOUND instead of ENOTDIR
[Fix] error code MODULE_NOT_FOUND instead of ENOTDIR
v1.3.3