Unable to publish new versions of private org packages in a monorepo setup to Github package registry

We heavily use Github package around the organisation account and all of our packages are private.

We have a monorepo that hosts multiple packages in a sub-folder called components.

We have already published all of those packages from the monorepo to github package registry (as private packages) using the lerna publish command which runs npm publish behind the scenes.

For some reason now we can’t publish new versions for any of the packages that belong to the monorepo repository.

When I run npm publish I get this error:

npm ERR! code E404
npm ERR! 404 Not Found - PUT https://npm.pkg.github.com/@[org-name]%2f[package-name] - The expected resource was not found.
npm ERR! 404 
npm ERR! 404  '@[org-name]/[package-name]@1.0.1' is not in the npm registry.
npm ERR! 404 You should bug the author to publish it (or use the name yourself!)
npm ERR! 404 
npm ERR! 404 Note that you can also install from a
npm ERR! 404 tarball, folder, http url, or git url.

Notice the version number 1.0.1, version 1.0.0 already exists in the registry.

The weird thing is that when I try to publish on an existing version 1.0.0 I get this error

npm ERR! code E400
npm ERR! 400 Bad Request - PUT https://npm.pkg.github.com/@[org-name]%2f[package-name] - failed to stream package from json: unhandled input: Cannot publish over existing version.

Which kinda tells me that github registry is correctly authenticated with my machine.

Our package.json layout looks like this

{
  "name": "@org-name/package-name",
  "version": "1.0.1",
  "description": "A button",
  "author": "mouhannad-sh <email@email.com>",
  "homepage": "https://github.com/org-name/monorepo#readme",
  "license": "ISC",
  "main": "lib/index.js",
  "types": "./index.d.ts",
  "directories": {
    "lib": "lib"
  },
  "files": [
    "lib",
    "index.d.ts"
  ],
  "scripts": {
    "test": "jest ${PWD}/src",
    "build": "rollup -c"
  },
  "peerDependencies": {
    "react": ">=16.8",
    "react-dom": ">=16.8"
  },
  "devDependencies": {
    "rollup-plugin-sass": "^1.2.2"
  },
  "gitHead": "REDACTED_GIT_HEAD_REF",
  "repository": {
    "type": "git",
    "url": "git+https://github.com/org-name/monorepo.git"
  },
  "bugs": {
    "url": "https://github.com/org-name/monorepo/issues"
  },
  "dependencies": {
    "classnames": "^2.2.6",
    "prop-types": "^15.7.2"
  }
}

So far I’ve tried the following and all yield the same results as above:
1- Issue a new personal access token and re register Github package registry with my npm client
2- use “publishConfig” in the individual package.json file for each package

"publishConfig": { 
    "registry": "https://npm.pkg.github.com/" 
  }

3- rename the folder directory to match the package name

It’s important to note that this issue is only happening on our monorepo, We are able publish all of our normal JS repos as private Github packages without any issues.

Thank is advance for any help :smiley: