np
np copied to clipboard
Publish won't recognize I'm logged into npm
Description
Even though I've successfully logged into npm, the publish from np keeps telling me I must log in.
Steps to reproduce
% npm login --scope @gargoylesoftware
<chop>
Logged in as gargoylesoftware to scope @gargoylesoftware on https://registry.npmjs.org/.
% yarn np publish 1.0.0
<chop>
Publish a new version of @gargoylesoftware/obj-for-dto (current: 1.0.0)
❯ Prerequisite check
✔ Ping npm registry
✔ Check npm version
✔ Check yarn version
✖ Verify user is authenticated
→ You must be logged in. Use `npm login` and try again.
Expected behavior
Environment
np - 7.6.2 Node.js - 18.6.0 npm - 8.13.2 Git - 2.32.3 OS - macOS Monterey version 12.4
I have the same problem, but only if I add np
to the devDependencies and run it via a custom script in package.json
. npx np
works though.
Same problem for me; can confirm the solution by @davidmondok works.
Thanks David. This issue is tracked in:
- https://github.com/sindresorhus/np/issues/592