Skip to content
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

Corepack and Yarn isolation in an nvm-managed environment #484

Open
marlondecol opened this issue May 28, 2024 · 1 comment
Open

Corepack and Yarn isolation in an nvm-managed environment #484

marlondecol opened this issue May 28, 2024 · 1 comment

Comments

@marlondecol
Copy link

A few hours ago I opened an issue in the nvm project repository to discuss a way to install package managers — in my case, Yarn — through Corepack separately for each version of Node.js. As I was told there, this should be discussed here, so I paraphrase my issue below.

My system has only two versions of Node.js installed and managed by nvm: the default is 20, which I use for almost all of my projects; the other one is 16. There is no other version of Node.js on this system, regardless of how it is installed. Both only have Corepack and NPM installed globally, each at the latest supported version.

The issue I come to discuss is that Corepack does not activate Yarn in isolation, i.e., every time a certain version of Yarn is activated in one of the Node.js versions, it is also activated in the other version. Therefore, I cannot, for example, use the latest version of Yarn on Node.js 20, as it is not compatible with 16.

Is there a way to isolate Yarn? Otherwise, wouldn't it make sense to implement it?

@SevenOutman
Copy link

SevenOutman commented Dec 2, 2024

Same issue here.

I was working on a project where .nvmrc set Node.js version to 22, and used Corepack to activate yarn.
When I switch to another project, despite nvm auto detected .nvmrc and set Node.js version to 14, running yarn still executed ~/.nvm/versions/node/v22.11.0/lib/node_modules/corepack/dist/yarn.js, which contains nullish coalescing syntax and doesn't work with Node.js 14.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants