I just received access to the github package registry. When trying to use np it fails in the prerequisite stage:
❯ Prerequisite check
↓ Ping npm registry [skipped]
✔ Check npm version
✖ Verify user is authenticated
→ Command failed: npm access ls-collaborators @willsub/logger
When I try npm access ls-collaborators @willsub/logger from the CLI that fails because it's trying to access the npm registry and not the github registry.
Problem #1
It seems np is not picking up the custom registry, even though I have that specified both in .npmrc and in "publishConfig".
If I add --registry=https://npm.pkg.github.com to the npm access command line, it fails:
❯ npm access ls-packages @willsub --registry=https://npm.pkg.github.com
npm ERR! code E404
npm ERR! 404 Not Found - GET https://npm.pkg.github.com/-/user/willsub/package?format=cli
Problem #2
It seems npm access is incompatible with the github registry. You might need to skip this step if the registry is github.
I do have the necessary config is my ~/.ssh/config.
np.I expect it to work as it does with the npm registry. Note that lerna was able to publish to the github registry successfully.
np - 5.0.3
Node.js - 12.4.0
npm - 6.9.1-next.0
Git - 2.22.0
OS - macOS 10.14.5
I ran into the same issue, without luck 😭
If you look at the code you can skip that pre-check by setting NODE_ENV=test (a quick source search told me that NODE_ENV seems to be used to skip that step only).
In my case npm publish failed after all the checks (I'll need to check the permissions), but this workaround may be helpful for you.
I'm just using npm version with a postversion script that commits and publishes.
I don't have access to the GitHub Package Registry, so I can't help much. But PRs are welcome to improve the situation.
It seems npm access is incompatible with the github registry. You might need to skip this step if the registry is github.
Please report this to the GitHub Package Registry team.
I've just published to GitHub using np 5.0.3. I did set up the scope beforehand, and had added publisherConfig to the package.json file.
Two observations:
master. I think we should push tags before publishing.Actually it looks like it always wants tags without v prefixes. Will see how / where I can ask about that and report back.
Actually it looks like it always wants tags without
vprefixes. Will see how / where I can ask about that and report back.
I've been given to understand this will improve.
I don't have access to the GitHub Package Registry, so I can't help much. But PRs are welcome to improve the situation.
@sindresorhus we have access with our (private) organization; we wouldn't mind helping you out with a collaborator account if this would make testing easier.
Thanks, I have access now too, but I’ve had no time recently because of summer vacation.
Actually it looks like it always wants tags without
vprefixes. Will see how / where I can ask about that and report back.I've been given to understand this will improve.
This leaves us with:
- You can't enable 2FA on the package. This step should be skipped.
np should be fully compatible with GitHub Package Registry now, though I have yet to try with the latest version.Can anyone confirm it works now? If so, we can document the support in the readme.
Yes this works, actually just published a package yesterday using:
$ np --version
5.1.3
Most helpful comment
433 dealt with the 2FA issue. I think
npshould be fully compatible with GitHub Package Registry now, though I have yet to try with the latest version.