Skip to content

Disable uninstall for corepack and npm #1536

@jan-vcapgemini

Description

@jan-vcapgemini

Task summary

As a corepack, yarn and npm user I don't want to uninstall corepack since this will break my installation.
I also don't want to uninstall npm with is my default package manager and break my node installation.
So we need to disable the uninstall command for corepack and npm.

Additional context

This issue is related to #907 and PR #1467

When the user does ide uninstall corepack or ide uninstall npm and the according tool is found to be installed, he should get the following message:

IDEasy does not support uninstalling the tool «tool» since this will break your installation.
If you really want to uninstall it, please uninstall the entire node installation:
ide uninstall node

I would recommend to implement this as a feature already in NodeBasedCommandlet so we can centralise the log message and logic and in Corepack and Npm we just enable this "feature" e.g. by overriding a new method isDisableUninstall().

Metadata

Metadata

Labels

corepackenhancementNew feature or requestinternalNothing to be added to CHANGELOG, only internal storynpmnode package manageryarnpackage manager alternative to npm

Type

Projects

Status

✅ Done

Relationships

None yet

Development

No branches or pull requests

Issue actions