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

nvm v0.40.0 introduced error if .nvmrc exists #10432

Closed
3 of 13 tasks
Skenvy opened this issue Aug 12, 2024 · 4 comments
Closed
3 of 13 tasks

nvm v0.40.0 introduced error if .nvmrc exists #10432

Skenvy opened this issue Aug 12, 2024 · 4 comments

Comments

@Skenvy
Copy link

Skenvy commented Aug 12, 2024

Description

See nvm-sh/nvm#3405.

Prior to the current nvm version, you could source $NVM_DIR/nvm.sh without issue, but the current nvm version, v0.40.0 appears to cause an error when trying to source, if you already have an .nvmrc present.

Platforms affected

  • Azure DevOps
  • GitHub Actions - Standard Runners
  • GitHub Actions - Larger Runners

Runner images affected

  • Ubuntu 20.04
  • Ubuntu 22.04
  • Ubuntu 24.04
  • macOS 12
  • macOS 13
  • macOS 13 Arm64
  • macOS 14
  • macOS 14 Arm64
  • Windows Server 2019
  • Windows Server 2022

Image version and build link

ubuntu-22.04
20240804.1.0
link

Is it regression?

20240730.2.0 link

Expected behavior

Should be able to source nvm.sh with an nvmrc present.

Actual behavior

"Error code 3"

Repro steps

name: Test nvm versions with nvmrc
on:
  workflow_dispatch:
defaults:
  run:
    shell: bash
env:
  UNAUTO_NODE_VERSION: v18.18.2 # "NODE_VERSION" is read by the nvm install script.
jobs:
  nvmrc-present-install-nvm:
    strategy:
      fail-fast: false
      matrix:
        # including all from the previous version on the runner, 'v0.39.5', to the current version, 'v0.40.0'
        nvm-version: ['v0.39.5', 'v0.39.6', 'v0.39.7', 'v0.40.0']
    runs-on: ubuntu-latest
    steps:
    - run: curl -o- https://raw.githubusercontent.com/nvm-sh/nvm/${{ matrix.nvm-version }}/install.sh | bash
    - run: echo "$UNAUTO_NODE_VERSION" > .nvmrc
    - run: source $NVM_DIR/nvm.sh && nvm install $(cat .nvmrc)
  nvmrc-present-default-nvm: # v0.40.0 atm
    runs-on: ubuntu-latest
    steps:
    - run: echo "$UNAUTO_NODE_VERSION" > .nvmrc
    - run: source $NVM_DIR/nvm.sh && nvm install $(cat .nvmrc)
  nvmrc-absent-default-nvm: # v0.40.0 atm
    runs-on: ubuntu-latest
    steps:
    - run: source $NVM_DIR/nvm.sh && nvm install $UNAUTO_NODE_VERSION
@vidyasagarnimmagaddi
Copy link
Contributor

Hi @Skenvy , We will be analysing the issue and provide solution. thanks

@vidyasagarnimmagaddi
Copy link
Contributor

Hi @Skenvy , the only possible solution is : Downgrade to a stable version of nvm (e.g., v0.39.7) that does not exhibit this issue until a fix is released . regards

@vidyasagarnimmagaddi
Copy link
Contributor

Hi @Skenvy , the issue nvm-sh/nvm#3405 , has been fixed , if not the possible workaround is to Downgrade to a stable version of nvm (e.g., v0.39.7) that does not exhibit this issue until a fix is released .Thanks closing this issue .

@Skenvy
Copy link
Author

Skenvy commented Aug 28, 2024

@vidyasagarnimmagaddi How long is it likely to be before the runners' installed version could be updated to the latest version that includes the fix, https://github.com/nvm-sh/nvm/releases/tag/v0.40.1

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

4 participants
@Skenvy @ijunaidm @vidyasagarnimmagaddi and others