Deprecate, unpublish, or recover an npm package
VSTS | TFS 2018 | TFS 2017
There are two options available to remove a version of an npm package from a feed.
- Deprecate: deprecating a version of a package adds a deprecation message that most npm clients, and VSTS, will show whenever the package is viewed or installed. Deprecating a version can help you discourage new usage of it by presenting a warning message when the package is installed.
- Unpublish: Unpublishing a version of a package makes it unavailable for install. After unpublishing, a package can be restored from the Recycle Bin within 30 days of deletion. After 30 days, it is permanently unavailable to restore. Unpublishing a package will cause others that depend on it to break.
Deprecate or unpublish an npm package VSTS
You must be a contributor to deprecate and an owner to unpublish.
Choose the package from the Packages hub in the Build and Release hub group and select the appropriate option from the menu:
Deprecate or unpublish an npm package using npm
- Set up the npm client with your feed.
- Deprecate a package by running
npm deprecate <package>[@<version>] <message>.
- Unpublish a package by running
npm unpublish <package>@<version>.
At this time, it's not possible to use
npm unpublish <package> to unpublish all versions.
Recover an unpublished npm package
If you've deleted/unpublished an npm package, NuGet package, or Maven artifact from Visual Studio Team Services (VSTS), builds that depend on that package will start to fail. You won't be able to repush that package to the feed because of immutability. In order to recover the package and have builds start working again, you can recover it from the Recycle Bin.
Find the Recycle Bin in the Packages page underneath the Build and Release hub in VSTS:
Once in the Recycle Bin, you will see any packages that have been deleted from the current feed in the past 30 days.
Click a package to get more details such as: Version, Deleted date/time, and Scheduled permanent deletion:
Select a version to Restore to feed: