-
Notifications
You must be signed in to change notification settings - Fork 3.2k
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
Update/Add nvm #4
Comments
👋 Thanks for the suggestion! Is there something that nvm does that isn't possible with the actions/setup-node action? |
Many nodejs projects already have a file in their repo that specifies a desired node version (e.g. If setup-node could detect and use the version specified in an existing .nvmrc then arguably installing nvm would not be necessary. Additional points:
|
* add release step * add creation release * move file to another folder * resolve comments * minor changes
This issue has not had any activity for 45 days and will be closed in 45 days if there continues to be no activity. |
I'm working with the |
Thanks for the suggestion @scottohara, we're going to add nvm as requested. @maxim-lobanov , let's do it, let me know if you need any additional assistance. |
@scottohara , before we start adding it to the Linux, could you please confirm that it works as expected on macOS images? I am asking because as I know, nvm doesn't work properly on macOS due to NVM initialization way and you have to write initialization trick in each pipeline:
After quick look, the same issue will happen on Ubuntu. @thejoebourneidentity , |
@maxim-lobanov the preinstalled nvm on the macOS image certainly works. Yes, you need to delete the npm prefix, and to have it pass through to each step you need to specify a login shell ( Other than that, it works fine.
|
This stopped working few hours ago. Now it uses some generic shell |
@Kerizer , no changes from our side for macOS images for the last 2-3 days... |
@Kerizer , your screenshot is from ubuntu image. NVM is not installed there. |
Still, we used nvm on Ubuntu as following:
And it worked for us for month. Starting from today it fails and it looks like macOS and Ubuntu now work in a different ways and are inconsistent. |
Thank you for the provided example, |
@maxim-lobanov we (me and @Kerizer) have been rather internally confused a bit, are you a Github staff memeber or just a core contributor/maintainer of this package? Our workflows are a bit clusterfucked now, since we relied quite heavily on NVM setup this way (you know, because no other way) and now it would be nice if we could at least point them to some commit where it's not yet broken 🙇 Thanks for quick responses anyway! |
Maintainer of I have found the root cause of your issue. And unfortunately, it caused by the latest Ubuntu image update. In scope of this update, we have added Could you please modify script a bit to fix your build? (the single difference is that we define
This script will unblock your build. Sorry for inconvenience and hope adding NVM to the image will improve your experience a bit :) |
Thanks for the explanation, much appreciated 🙌 We are not against a breaking migration, if it's really necessary, since we sort of relied on not that much documented feature, but I guess we could make somewhat a "major" release of images where it would be possible to upgrade?
I know it was mentioned before, but it would rather make sense to have a way to update images in the backwards incompatible way with providing a path to migrate to them, no? I mean if we look at version of If we look at example from CircleCI, they have similar stuff: Now after writing all this, I think the problem here which has surfaced, that versioning of images is too tightly coupled to versioning of distributions, which has backfired when you started to need to have two different versions of the same distro for fixes like #491 I understand that this is oftopic of this issues, and I can help creating a new one, if you guys agree this is a problem |
@dentuzhik, Yes, please create the issue for your proposal. As I know, we don't have any plans in this direction at the moment but it would be great to have the issue where we can track popularity of this proposal. |
Also note that there is currently a way to freeze the toolsets and image. Self-hosted runners (on cloud VMs as well). Yes, much less convenient but at the other end of the spectrum on the control vs convenience spectrum. Not saying that having a way to pin or do n-1 on images, isn't very useful. Just highlighting as an option. Off topic but actions also have a way to pin to a specific version (ref or sha). So between self-hosted and what you choose to pin to, it is possible to lock down. One thing you can't lockdown (until actions is in GHES) is the service itself and that moves forward. |
This is indeed a valid point. However I would assume that the default option, which is provided to consumers of this package, should be safe enough to avoid accidental breaking. Therefore there should likely be both a way to push to upstream and let others update (docker Versioning in a way that everyone is happy is hard. |
Hello, pull request was merged and changes would be added in the next images rollout. |
Hello, changes were added. If you have any concerns please feel free to reopen the issue. |
shouldn't sth like this:
work now?
|
nvm is a shell function, not an executable.
|
Note, for each |
A little off topic, but wanted to document somewhere just incase someone else was struggling with getting nvm to work with self hosted runners and very little set up each step. If you're building your own runners images I found this works pretty well.
From here |
The version of nvm that seems to be present on the runners atm is v0.39.2 - I published v0.39.3 earlier today. How long should it take before that's updated? I'd have hoped it's largely in realtime. |
Since # Use nvm because actions/setup-node does not install latest versions
# https://github.com/actions/setup-node/issues/940
- name: Install latest LTS with nvm
run: |
nvm install 'lts/*'
echo "$(dirname $(which node))" >> $GITHUB_PATH
shell: bash -l {0} This allows all further workflow steps to use the new - run: node --version # v20.16.0 (latest LTS just installed by nvm)
- run: which node # /home/runner/.nvm/versions/node/v20.16.0/bin/node |
Tool information
.nvmrc
fileVirtual environments affected
(Already installed one macOS virtual env)
Can this tool be installed during the build?
Yes, but not easily. See https://github.community/t5/GitHub-Actions/How-to-share-shell-profile-between-steps-or-how-to-use-nvm-rvm/td-p/33185
Are you willing to submit a PR?
The text was updated successfully, but these errors were encountered: