-
-
Notifications
You must be signed in to change notification settings - Fork 33.5k
Closed
Labels
discussIssues opened for discussions and feedbacks.Issues opened for discussions and feedbacks.moduleIssues and PRs related to the module subsystem.Issues and PRs related to the module subsystem.
Description
Currently, Node.js resolves symlinks when requiring and then uses the real location of the package/file as its __filename and __dirname instead of the symlinked one.
This is a problem because symlinked modules don't act the same as locally copied modules.
For example:
app
index.js //require("dep1")
node_modules
dep1
index.js //require("dep2")
dep2
index.js //console.log('fun!'):
works, but
app
index.js //require("dep1")
node_modules
dep1 -> ../../dep1
dep2
index.js
dep1
index.js //require("dep2")
does not, because dep1 does not act like it's located in the node_modules directory of module and thus cannot find dep2.
This is especially a problem when one wants to symlink modules that have peer-dependencies.
Therefore, I suggest changing the behavior to no longer resolve symlinks.
What do you think?
mgcrea, SystemParadox, mathieumg, andynoelker, kzc and 64 morealexanderGugel, nowtvicebergteam, edef1c, cnbcg and charlesoconorTonimo, stq, webdevbyjoss, 0xcaff, yiakwy and 2 more
Metadata
Metadata
Assignees
Labels
discussIssues opened for discussions and feedbacks.Issues opened for discussions and feedbacks.moduleIssues and PRs related to the module subsystem.Issues and PRs related to the module subsystem.