-
Notifications
You must be signed in to change notification settings - Fork 334
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
Fix: sync nodejs versions #1202
Fix: sync nodejs versions #1202
Conversation
@@ -218,7 +218,7 @@ in | |||
] | |||
++ lib.optional cfg.npm.enable (cfg.npm.package) | |||
++ lib.optional cfg.pnpm.enable (cfg.pnpm.package) | |||
++ lib.optional cfg.yarn.enable (cfg.yarn.package) | |||
++ lib.optional cfg.yarn.enable (cfg.yarn.package.override { nodejs = cfg.package; }) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
do we also need this for pnpm?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yea pnpm has the same problem but this override only works because yarn package supports it. Pnpm is a nodePackage which sadly doesn't support this (same problem if you would use nodePackage.yarn instead of yarn)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Only way I found to fix that was using overlay to fix all nodejs to specific version
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Underlying nix issue: NixOS/nixpkgs#145634
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Something like this also works: cfg.package.pkgs.pnpm
. This installs pnpm with the correct node version, but not sure if all node pkgs support this (tested with pkgs.nodejs_21;
), will do some more testing.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Doesn't work with nodejs-slim pkg so not sure what the best way forward is here. Supporting overlays seems like the only way to support all different pkgs.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Commented workarounds in original issue aswel so people can still use this until a proper fix is ready. Do you reckon moving away from slim nodejs is a good solution?
This fixes yarn using a different nodejs version (partially solves #637). This doesn't work if yarn pkg is a
nodePackage
. Pnpm also has the same problem since it's anodePackage
, not sure how to fix that, seems to use the first node version that is installed.