actions / runner-images

GitHub Actions runner images
MIT License
9.82k stars 3.01k forks source link

Update/Add nvm to windows-latest #4471

Closed ljharb closed 2 years ago

ljharb commented 2 years ago

Tool name

nvm

Tool license

MIT

Add or update?

Desired version

v0.39.0

Approximate size

No response

Brief description of tool

nvm is already included on ubuntu-latest and macos-latest. nvm also supports WSL, but it's not included on windows-latest. Could it be added?

(i'm the nvm maintainer)

URL for tool's homepage

https://nvm.sh

Provide a basic test case to validate the tool's functionality.

No response

Virtual environments affected

Can this tool be installed during the build?

Yes, just like on the mac and ubuntu images.

Tool installation time in runtime

No response

Are you willing to submit a PR?

Yes, but I'll need some pointers.

al-cheb commented 2 years ago

Hello, @ljharb We don't have any plans to pre-install WSL environment related to maintenance concern. Could we install nvm on Windows Server without using WSL?

ljharb commented 2 years ago

nvm also works in git bash and cygwin; https://github.com/actions/virtual-environments/blob/main/images/win/Windows2019-Readme.md doesn’t mention those but it does mention Bash - it’s only bash if it’s posix compliant, and nvm works in posix shells, so i assumed that “bash” meant that WSL is installed.

fowl2 commented 2 years ago

a potential alternative to this would be to enhance the NodeTask to support nvmrc files :)

fowl2 commented 2 years ago

Also potentially relevant is this from the nvm README:

Note: nvm also support Windows in some cases. It should work through WSL (Windows Subsystem for Linux) depending on the version of WSL. It should also work with GitBash (MSYS) or Cygwin. Otherwise, for Windows, a few alternatives exist, which are neither supported nor developed by us:

maxim-lobanov commented 2 years ago

Support of nvmrc files was recently added to setup-node task: https://github.com/actions/setup-node/releases/tag/v2.5.0 We wouldn't like to bake nvm into the images

ljharb commented 2 years ago

@maxim-lobanov why not? it’s already baked into the others, and it’s far more capable and powerful than setup-node, which is why I’d prefer to use it.

also, you don’t support .nvmrc files unless you also support every alias nvm does - both custom ones, and also node, iojs, stable, lts/argon etc. do you? (cc @dmitry-shibanov)

ljharb commented 2 years ago

ping; i'd still like to hear an answer to the question.

ljharb commented 9 months ago

@maxim-lobanov ping?

ljharb commented 8 months ago

@maxim-lobanov @shamil-mubarakshin ?