Skip to content

Improve uninstall error message for missing versions#3768

Merged
ljharb merged 1 commit intonvm-sh:masterfrom
PeterDaveHello:fix-uninstall-message
Jan 29, 2026
Merged

Improve uninstall error message for missing versions#3768
ljharb merged 1 commit intonvm-sh:masterfrom
PeterDaveHello:fix-uninstall-message

Conversation

@PeterDaveHello
Copy link
Collaborator

Include the requested version in the uninstall error output when the target is not installed.

Add a fast test to lock the behavior.

Close #3767

GitHub Copilot summary:

This pull request improves the error messaging in nvm.sh when attempting to uninstall a Node version that is not installed. It also adds a new test to verify the updated error message behavior.

Error handling improvements:

  • Improved the error message in the nvm() function in nvm.sh to specify the requested version more clearly when an uninstall is attempted for a version that is not installed. Now, if the inferred version differs from the requested pattern, the message indicates which version was inferred; otherwise, it states the requested version is not installed.

Testing:

  • Added a new test script test/fast/Running 'nvm uninstall' with an uninstalled version shows the requested version to ensure that uninstalling a non-installed version returns the correct error message.

@ljharb ljharb force-pushed the fix-uninstall-message branch from 751504b to c8ddedc Compare January 28, 2026 00:44
@ljharb
Copy link
Member

ljharb commented Jan 28, 2026

can we get a test for the "inferred" message branch?

Include the requested version in the uninstall error output when

the target is not installed.

Add a fast test to lock the behavior.

Close nvm-sh#3767
@PeterDaveHello
Copy link
Collaborator Author

@ljharb PR revised!

@ljharb ljharb merged commit 5533699 into nvm-sh:master Jan 29, 2026
200 of 203 checks passed
@ayazkhanjutt85-crypto

This comment was marked as spam.

@PeterDaveHello PeterDaveHello deleted the fix-uninstall-message branch February 6, 2026 15:03
Copy link

@Chavrzp28 Chavrzp28 left a comment

Choose a reason for hiding this comment

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

Configuracion y Sincronizacion

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.

nvm uninstall: request "22" but error message shows N/A

4 participants