-
-
Notifications
You must be signed in to change notification settings - Fork 185
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Result differs from Node's require.resolve when using basedir
option with symlinks
#295
Comments
Yes, that's because of the |
Thanks for the response! I take it this means that, for this example, resolve v1 should never resolve to the same path as Node's resolve, regardless of what value is provided for |
That doesn't sound right - resolve v1, by default, will match node < 6's resolve behavior. If you set preserveSymlinks to resolve v2's prerelease will match modern node (modulo "exports") unless you set preserveSymlinks to (the flag was added in node 6.3, i'm not actually sure when node's default was changed - probably node 7 or 8?) |
I'm actually not seeing a difference between running this with Node 16 (what I ran on originally) and Node v6...
|
It could be older than that :-) try node 4 or 5? Either way I'm more than happy to add these as test cases, whether it's a bug or not. |
I'm getting the same result using v4 and even v2 actually |
hm, weird. it could be even older - 0.12 or 0.10 - without the test case locally i have to ask you to keep trying :-D |
Same result with 0.12, 0.10, and even 0.8 (which is the lowest I can install without |
wow, then i have no idea. want to send a PR with tests that match your expectations, and i'll see what i can do? |
Hi, Ive noticed an issue that arises when using this package alongside
npm link
oryarn link
- when resolving from a linked dependency's directory asbasedir
, this package will resolve to a module in the linked packagesnode_modules
. This is in contrast to Node'srequire.resolve
, which will resolve to the root levelnode_modules
(same as if the package wasn't linked).For example, if
resolve-example
depends on a packagetest-pkg
,test-pkg
itself depends onlodash
, and I linkresolve-example
totest-pkg
usingyarn link
, here's what I see after running the followingI'd expect these results to match for each value of
opts
The text was updated successfully, but these errors were encountered: