-
Notifications
You must be signed in to change notification settings - Fork 29.6k
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
experimental-specifier-resolution=node breaks symlinked (e.g. pnpm) package structure #42244
Comments
Yes that does sound very similar, thanks. I'm unfamiliar with building node from source, but will address this over the coming day or so to check. |
You can also use one of the nightly builds (the most recent one at the time of writing can be found at https://nodejs.org/download/nightly/v18.0.0-nightly202203074158d62dec/ and |
Yep that fixes it, many thanks. So this will be in the 18.0.0 release? Is it likely to be back-ported to any other major versions? Just wanting to understand my users' system requirements once this rolls out. |
Revert to symlinked node_modules (works with Node 18, see nodejs/node#42244). Add missing peer deps.
It will be in v18.0.0, and it should also be backported to the next v17.x release, and later in a v16.x release. Good to hear that fixed it for you, closing :) |
Thanks again, great result. |
Version
17.6.0 and 16.14.0
Platform
Darwin MacBook-Pro.local 19.6.0 Darwin Kernel Version 19.6.0: Tue Aug 24 20:28:00 PDT 2021; root:xnu-6153.141.40~1/RELEASE_X86_64 x86_64
Subsystem
internal/modules/esm/resolve
What steps will reproduce the bug?
ensure pnpm is installed globally
In a new, blank directory, add the following package.json:
Run
pnpm install
Run node (interactive with no flags), and the following works:
node --experimental-specifier-resolution=node
and it no longer worksHow often does it reproduce? Is there a required condition?
Always
What is the expected behavior?
I expect the flag to only affect the behaviour relating to file extensions.
What do you see instead?
The flag also produces a changed behaviour in terms of the module search path with symlinked modules.
Additional information
I would expect the
--experimental-specifier-resolution
flag to only affect the behaviour with regard to the ".js" extension, at least that is what I am aiming at, so I can use Typescript output without post-processing all files to have ".js" extensions or similar workaround. This works fine if I use the "shamefully-hoist" flag in pnpm installation, so that all packages are flattened at the top level of node_modules. If that is indeed the intended behaviour of--experimental-specifier-resolution
- i.e. that it should change BOTH the file extension behaviour AND the symlinked path behaviour, then is it possible in any way to get the desired behaviour (working without ".js" extensions) without the undesired behaviour (different interpretation of symlinked paths).The text was updated successfully, but these errors were encountered: