Skip to content

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.

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
@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?

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

2 participants