Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How can I remove a tag from npm?

Tags:

npm

I've published a grunt plugin to npm that's been tracking the grunt 0.4 RCs by using the master tag. I've been publishing with:

npm publish --tag master

Now that grunt 0.4 final has been released, I've re-published my plugin as latest via:

npm publish

How can I now remove the master tag from the npm repository? It is still listed in dist-tags when I npm view [my-plugin].

Thanks in advance.

like image 296
Dan Gebhardt Avatar asked Feb 19 '13 04:02

Dan Gebhardt


People also ask

Can you delete from npm?

Log in to npm with your user account. Navigate to the package page for the package you want to unpublish, replacing <your-package-name> with the name of your package: https://www.npmjs.com/package/<your-package-name> . Click Settings. Under "delete package", click Delete package.

Can you unpublish from npm?

To unpublish a single package version, run npm unpublish <package_name>@<version> . If all the versions of a package can be unpublished, you can unpublish all versions at once by running npm unpublish <package_name> --force .

What is npm tag?

npm registries support tags, which are string aliases for package versions. You can use tags to provide an alias instead of version numbers. For example, you might have a project with multiple streams of development and use a different tag (for example, stable , beta , dev , canary ) for each stream.


2 Answers

It was not possible to remove dist-tags from the npm registry prior to [email protected]. There is now a command-line syntax for this, provided you update to a new version of npm -- see https://github.com/npm/npm/wiki/Troubleshooting#try-the-latest-stable-version-of-npm for full details on upgrading.

Install latest version of npm

npm install -g npm    # most common way to upgrade

Clear a tag that is no longer in use from the package.

npm dist-tag rm <pkg> <tag>
like image 145
Sam Mikes Avatar answered Sep 20 '22 01:09

Sam Mikes


master may be in your npm config.

check what this gives:

npm config get tag

To get back to use latest, this should do:

npm config set tag latest

An other possibility is to un-publish the version with the master tag using:

npm unpublish <name>[@<version>]

this is likely to remove the tag in dist-tags (but since I haven't tried, not certain).

like image 23
Pascal Belloncle Avatar answered Sep 20 '22 01:09

Pascal Belloncle