Github Package Registry scope conflict with proxy

We have had an organisation scoped on npm for some time, for the sake of example let’s call this org ORGNAME, now with the github package registry, and due to our github org bearing the same name as our npm scope, both scopes are the same. ie: we publish public packages to the ORGNAME scope on npm, private packages to the ORGNAME scope on github

It seems that even though we changed to the new proxy setup as explained in the blog, setting up the npmrc file using 

registry=https://npm.pkg.github.com/ORGNAME

the registry will not resolve internally to fall back to the public NPM packages in case the private GitHub package is not available. 

wondering if I’m doing something wrong?

6 Likes

Hi Vincent,

I’m not sure if this is any help, but I ran into a similar issue and was able to resolve it by doing this:

@ORGNAME:registry=https://npm.pkg.github.com
registry=https://registry.npmjs.org
2 Likes

that did the trick, thanks

1 Like

Seems like it doesn’t work anymore. If it works for you, can you pin .npmrc, node version and yarn/npm version?

Thank you!

This solution is not working for me as of date.

This isn’t the solution.

What this does is make npm look for all packages with scope @orgname on the GitHub package registry. If you also have scoped packages on npm, this approach completely breaks down.

This is still very much an issue and is a showstopper for using the GitHub registry alongside the npm registry.

Another example:

  • @lukeed/privateA -> private on GitHub

  • @lukeed/uuid -> public on npm

Regardless of order, this .npmrc is incapable of successfully installing both packages into a project:

@lukeed:registry=https://npm.pkg.github.com/lukeed
registry=https://registry.npmjs.org
2 Likes

I’ve faced with the same issue =(

It is not a solution for the issue: https://gist.github.com/azu/31530916cbce0fd2fc1f4d8f6cf0fae1

I have unmarked the solution, since somewhere down the line, the proxying portion of GHPR stopped working.