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
Node uses the real path of modules (except when executed with --preserve-symlinks) to resolve dependencies. That is why pnpm's symlinked node_modules work fine with Node applications.
However, resolve is a really popular and widely used package and it does not use the real path of modules to resolve dependencies. As a consequence, a lot of tooling fails with pnpm. See the most recent issue: pnpm/pnpm#857. And also many of these might be related: pnpm/pnpm#801
Would you accept a pull request to change the behavior of resolve to work the way Node does? It won't change anything for projects that use npm/Yarn because they don't leverage symlinks but it would be a huge help for the pnpm community!
Sure, that sounds good - let's ensure that a) existing tests keep passing (ofc), b) we add a "preserve symlinks" option, so users can control the behavior if they like, and c) let's think carefully about if it's possible to avoid a semver-major.
Activity
ljharb commentedon Jul 24, 2017
Sure, that sounds good - let's ensure that a) existing tests keep passing (ofc), b) we add a "preserve symlinks" option, so users can control the behavior if they like, and c) let's think carefully about if it's possible to avoid a semver-major.
feat: add preserveSymlinks option
feat: add preserveSymlinks option
[Breaking]: add `preserveSymlinks` option
feat: add `preserveSymlinks` option
feat: add `preserveSymlinks` option
[New]: add `preserveSymlinks` option
v1.4.0
malash commentedon Nov 26, 2018
@zkochan Did you forget to change this condition when resolving real path for
basedir?resolve/lib/sync.js
Line 29 in fed3f0f
E.g. this line may fail
require('resolve').sync('../../path/to/another/package', { basedir: '/path/to/a/symlink' }).FYI @ljharb
ljharb commentedon Nov 26, 2018
@malash could you file a separate issue for that, with a test case?
malash commentedon Nov 27, 2018
I'v create a new issue with bad case example #177