-
Notifications
You must be signed in to change notification settings - Fork 243
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 versions of npm, yarn and pnpm #266
Conversation
src/nixpacks/builder/docker.rs
Outdated
@@ -317,6 +317,10 @@ impl DockerBuilder { | |||
|
|||
WORKDIR {app_dir} | |||
|
|||
# Update channels |
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.
I don’t think we should be referencing a third party channel for all builds, especially when the channel is outside of the main nixpacks repo.
I also think the problem only existed for pnpm and npm/yarn worked as expected.
if possible I think we should fix this issue upstream vs installing node from a new channel.
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.
Alternatively we could use an overlay, which nixpacks already has support for. Similar to the rust provider https://github.com/oxalica/rust-overlay
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.
I don’t think we should be referencing a third party channel for all builds
It will be hosted by you. Furthermore, as you can see inside the channel, these new packages only downloads the package manager from NPM, unzips it and binds it.
I also thought of putting it inside the docker image, but it wouldn't be updated as often
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.
I've implemented overlays, so the channel doesn't get referenced in every build
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.
Works great! Thanks 😄
Fixed incorrect versions of npm, yarn and pnpm. The solution was creating a custom Nix Channel, mainly because there is a long-running issue inside nix about these packages not installing correctly:
result/bin
symlink, norresult/lib/node_modules/.bin
symlinks svanderburg/node2nix#293nodePackages_latest
don't result in executables in $PATH. NixOS/nixpkgs#145432The channel is currently hosted here, but it'll be better if you host it