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
feat: replace deb.nodesource.com with n, fixes #5509 #5521
Conversation
Download the artifacts for this pull request:
See Testing a PR |
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.
Requires installation in the Dockerfile right?
what do you mean? It modifies the Dockerfile yes, but not the main ddev image, just the one for each project. It modifies as before when you specify a version. |
I think the initial nodejs installation should be done via n probably? ddev/containers/ddev-php-base/Dockerfile Lines 64 to 65 in 4932337
|
The recommended way is actually installing it through I thought the node version was on the original image coming form debian, not that you were setting a default initial version yourself. So we can do either, continue installing the default node version the way you are doing and use n only for changing it, or, as per https://github.com/tj/n#installation you can do:
18 or whatever you want. From https://docs.platform.sh/languages/nodejs/node-version.html, if you compare the installation for n vs nvm, you see it's much more straightforward. |
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.
This seems like it's close, but the docs have to be updated explaining the range of versions allowed, and the template.go comment instructions need statement that minor versions are supported right?
What about adding info about "Why do we need nvm at all then"? (Do we?)
pkg/ddevapp/nodejs_test.go
Outdated
@@ -41,7 +40,8 @@ func TestNodeJSVersions(t *testing.T) { | |||
err = app.Start() | |||
require.NoError(t, err) | |||
|
|||
for _, v := range nodeps.GetValidNodeVersions() { | |||
// Testing some random versions | |||
for _, v := range []string{"6", "10", "14", "16", "20"} { |
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.
Shouldn't this have some examples with minor versions?
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.
Sure
This an interesting question. I don't think we do, but some people are used to it, so removing it altogether is a bit step, I guess that if you removed phpmyadmin you can do that with this and move it to an add on, which might not be a bad idea but I'd do that as a separate issue/PR. I'll add some more info to template.go, I did change that to account for any "node version" but I can try thinking of something more specific. |
49a398c
to
6094654
Compare
Further more, using n once you start the project is not possible (this can be improved with permissions):
Obviously N_PREFIX can point to something else, even the shared mnt, but again, if people are used to nvm I thought easier to just leave |
Updated docs and tests |
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.
Impressive simplification!
It also "fixes" the problem described here:
951f259
to
b96c0f4
Compare
Rebased. |
b96c0f4
to
a477a9e
Compare
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.
Rebased and added minor docs changes. I think this is pretty fantastic. It will resolve the conflict people always feel between major version and nvm.
Awesome change, thanks so much @hanoii! 👏 👏 👏 |
I'm quite a fan of this as well. Simply fantastic. |
Brilliant! |
A followup on this:
|
I figured this one was quick to do if you want to give it a try.