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

Fix versions of npm, yarn and pnpm #266

Merged
merged 12 commits into from
Jul 9, 2022
Merged

Conversation

JuanM04
Copy link
Contributor

@JuanM04 JuanM04 commented Jul 7, 2022

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:

The channel is currently hosted here, but it'll be better if you host it

@@ -317,6 +317,10 @@ impl DockerBuilder {

WORKDIR {app_dir}

# Update channels
Copy link
Contributor

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.

Copy link
Contributor

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

Copy link
Contributor Author

@JuanM04 JuanM04 Jul 7, 2022

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

Copy link
Contributor Author

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

Copy link
Contributor

@coffee-cup coffee-cup left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Works great! Thanks 😄

@coffee-cup coffee-cup merged commit 5e8dbac into railwayapp:main Jul 9, 2022
@JuanM04 JuanM04 deleted the pnpm-fix branch July 9, 2022 00:17
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

Successfully merging this pull request may close these issues.

2 participants