Tony_Henrich
Tony_Henrich

Reputation: 44185

Uninstall-Package xxx –RemoveDependencies doesn't uninstall the dependencies

I am trying to uninstall jQuery package using the –RemoveDependencies flag however it's complaining that other jQuery packages depend on it.

Shouldn't this flag make NuGet uninstall all the dependencies? Using Nuget Manager 3.4.4 in VS 2015.

Upvotes: 0

Views: 418

Answers (2)

Matt Ward
Matt Ward

Reputation: 47967

Unfortunately that is not how the RemoveDependencies flag works. It is used to remove the packages that the package being removed depends on, not the other way around.

If you have jQuery and jQuery.Validation installed you can remove both of these with the RemoveDependencies option by uninstalling jQuery.Validation.

uninstall-package jquery.validation -RemoveDependencies

However if you try to directly uninstall jquery even with the RemoveDependencies option it will fail with an error since jQuery.Validation depends on it.

Upvotes: 0

Weiwei
Weiwei

Reputation: 3776

According to the description for –RemoveDependencies from this link, it mentioned that "Uninstalls the package and its unused dependencies.". It means you need to uninstall the package that dependent on the dependencies package at the same time.

If you want to remove the dependencies, I suggest you uninstall all packages that contains the packages dependent on it. And then reinstall the package with following command, which will install the package only without dependencies.

install-package PackageName -IgnoreDependencies

Upvotes: 0

Related Questions