-
Notifications
You must be signed in to change notification settings - Fork 1.1k
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
Yarn PnP activating when project has nodeLinker: node-modules #3876
Comments
I'm not sure it's normal for there to be a .pnp.cjs file in the home dir. I may have accidentally initiated a project in my home dir. No idea how that happened, but I also had a .git directory there... After a 2nd fresh install, I did not get a "random" .pnp.cjs in my home dir, and things worked fine. So maybe then it looked like nested project which I don't know the expected behavior of, but doesn't concern me. Feel free to close. Sorry for the trouble |
Duplicate of #2647
That's the most likely explanation, Yarn shouldn't write it to the home directory unless you run an install there. |
It seems that if my home folder contains a .pnp.cjs file, esbuild uses PnP even if the project itself is configured with
nodeLinker: node-modules
in its.yarnrc.yml
.I'm not sure if the problem is on esbuild or on Yarn.
I'm on WSL2 with Ubuntu 24.04, with esbuild 0.23.0, yarn 4.3.0. I just did a fresh install. Installed nvm, then node 20, then corepack enable. My project was already setup for node-modules mode with its
.yarnrc.yml
.Every package would be unresolvable within esbuild. Using verbose logging, I got this kind of output for each import:
If I rename the .pnp.cjs file from my home dir, then things work and pnp is not used.
My understanding is that
nodeLinker: node-modules
in the project's.yarnrc.yml
should turn pnp off for that project. But it clearly doesn't (at least for esbuild). Am I doing something wrong? I'm just hoping to save someone else's time since the logs without verbose are not helpful for this issue.Thanks
The text was updated successfully, but these errors were encountered: