Welcome to the Inedo Forums! Check out the Forums Guide for help getting started.
If you are experiencing any issues with the forum software, please visit the Contact Form on our website and let us know!
[ProGet] [NativeApi] NpmPackages_DeletePackage not working.
-
Hello!
I'm trying to delete a npm package from a feed via native api.await fetch(`${host}/api/json/NpmPackages_DeletePackage`, 'post', { 'Content-Type': 'application/json' }, JSON.stringify({ Feed_Name: 'npm', Package_Name: name.split('/').pop(), // `pkgname` Scope_Name: name.split('/')[0], // '@myscope` API_Key: this.token, Version_Text: pkg.Version.toString() // `2.3.4` }));
And it returns
200: OK
with simple headers'content-length': '0', 'cache-control': 'private', 'x-proget-version': '5.3.24.7', 'strict-transport-security': 'max-age=31536000; includeSubDomains', 'x-frame-options': 'SAMEORIGIN', 'x-content-type-options': 'nosniff', 'x-xss-protection': '1; mode=block',
But a package remains in a feed.
How can I remove a package from npm feed with api?
ProGet version 5.3.24 hosted on docker
-
Hello,
That API will only delete package metadata from the database, not from disk. It's mostly intended for internal use only, and probably shouldn't be exposed to the API. In any case, we don't store the
@
with internally, so if you change@myscope
tomyscope
it should work.Note that the NPM doesn't provide a way to delete packages, and we never implemented it. There hasn't been any demand for it to date, as people don't really delete packages programmatically - but you're definitely welcome to submit a feature request and help us understand why it'd be a value (like, the workflow you use that requires deleting packages, etc).
Alana