What's the mean of "If X begins with '/'. set Y to be the filesystem root"? #36749
Unanswered
JianmingXia
asked this question in
General
Replies: 1 comment 1 reply
-
The simplest, is just to resolve the path into an absolute path, this will be the recommended approach for most if not all cases.
If you really need to make require act as if it is in a different directory, you can push the base directory to module.paths
module.paths can also be modified externally via the environment variable NODE_PATH, tho that would be the least recommended |
Beta Was this translation helpful? Give feedback.
1 reply
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
folder: /Users/ryoma/web/Test/NodeJS/NodeTest
files:
In link https://nodejs.org/api/modules.html#modules_all_together, I see:
So, when I run node b.js, I get like below:
And how do i understand If X begins with '/'. set Y to be the filesystem root
Beta Was this translation helpful? Give feedback.
All reactions