Move NPM package to other repo "Package is already associated with another repository"

I would like to move a package from one repository to another.

Consider this:

I have an organisation at “@org

I have 2 packages associated with one ‘monorepo’ “github.com/org/test” called “@org/test1” and “@org/test2”

No I want to move “@org/test1” to its own repo in the organisation like “github.com/org/test1

I change the repo in “package.json” like this:

"name": "@org/test1",
  "publishConfig": {
    "registry": "https://npm.pkg.github.com/"
  },
  "repository": {
    "type": "git",
    "url": "ssh://git@github.com/org/test1.git",
    "directory": "packages/test1"
  },

But I am getting this error:

422 Unprocessable Entity - PUT https://npm.pkg.github.com/@org%2ftest1 - Package "test1" is already associated with another repository.

How can I change this? Since the package stays in the namespace I expect this to work just fine.

4 Likes

I still need help for this!

It looks like Github Packages requires  last part of the name (“test1” in you case) be unique. 

Then what’s the point in org namespaces? Isn’t this a bug?

Then what’s the point in org namespaces? Isn’t this a bug?

I totally agree, right now I’m facing the same problem. Maybe someone could let us know if the current behavior will be enhanced?

Any update on the issue? The bug is really frustrating and is forcing to move back to NPM registry. Also, the same issue with renaming repository - if you rename it, you will have the same error message.