Closed nikitaeverywhere closed 6 years ago
This is on windows, right? any node version? This sounds like a bug with node, and should be addressed even if it is patched here.
@stevelacy, thanks for the hint!
This is on windows, right? any node version?
Windows 10.0.15063 / NodeJS 8.2.1 (latest), the same:
λ node -v
v8.2.1
Z:\ZitRos\Projects\TimingKit (master) (zitronic-timing-kit@0.35.5)
λ node
> const requireDir = require("require-dir")
TypeError: Path must be a string. Received null
at assertPath (path.js:28:11)
at Object.dirname (path.js:716:5)
at Object.<anonymous> (Z:\ZitRos\Projects\TimingKit\node_modules\require-dir\index.js:12:22)
at Module._compile (module.js:569:30)
at Object.Module._extensions..js (module.js:580:10)
at Module.load (module.js:503:32)
at tryModuleLoad (module.js:466:12)
at Function.Module._load (module.js:458:3)
at Module.require (module.js:513:17)
at require (internal/module.js:11:18)
Look like this here may not be defined... @stevelacy, have you ever took a look on NodeJS sources? Maybe you know the place to dig deeper? Thank you!
Can you run the tests for node v8.2.1? This may be a windows edge case which is untested, and would need fixing in core.
Can you run the tests for node v8.2.1?
That's not trivial :) I will try tomorrow.
This issue started to mysteriously appear not only in Intellij Window, but across the system... Now I cannot launch my project locally. Strange.
And now I can again (tried npm install --save require-dir@latest
). Super strange.
Hi - new maintainer here. Is this still an issue you're having or was it solved by more recent versions of node?
Hi @contra! I'm not sure; I didn't use this module for a long time. That issue were very strange, appearing only a couple of times but not always. I think if no people give their feedback here that was most likely the problem with my configuration/system somewhere.
@ZitRos Cool, will close and reopen if somebody else reports it again. Thanks for responding.
Hello!
I think the issue I experienced today is kind of a rare one, but it may happen to anyone else as it did for me. I am not sure what exactly causes
module.parent.filename
to beundefined
, but when Irequire
drequire-dir
from the Intellij IDEA command line, it gave me the following (I am using cmder):The change I propose fixes this problem: it just defaults filename to an empty string, which works as expected:
Thanks!