Not Found - PUT https://npm.pkg.github.com/package-name Not Found - PUT https://npm.pkg.github.com/package-name git git

Not Found - PUT https://npm.pkg.github.com/package-name


There are two ways to solve this problem:

  1. Specify publishConfig option in package.json:
"publishConfig": {    "registry":"https://npm.pkg.github.com/@OWNER"},
  1. Add .npmrc file to your project with this content:
registry=https://npm.pkg.github.com/@OWNER

replacing OWNER with the name of the user or organization account on GitHub that owns the repository where you will publish the package.


For example:

{  "name": "@elvisjs/calling-elvis",  "repository": {    "type": "git",    "url": "https://github.com/elvisjs/calling-elvis"  },  "publishConfig": {    "registry": "https://npm.pkg.github.com/elvisjs"  }}

The name, repository/url and the publishConfig/registry must be matched.


Github Package registry expected the name properties on package.json to be "@{github username}/{package name}for example:-

"name": "@pravanjan/local-time","publishConfig": {      "registry": "https://npm.pkg.github.com/"  },

If "publishConfig" is not set in package.json we can directly set the registry parameter in terminal

npm publish --registry=https://npm.pkg.github.com/ 

This did work for me