np icon indicating copy to clipboard operation
np copied to clipboard

Publish won't recognize I'm logged into npm

Open grosch opened this issue 1 year ago • 1 comments

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

grosch avatar Jul 23 '22 19:07 grosch

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.

davidmondok avatar Aug 29 '22 10:08 davidmondok

Same problem for me; can confirm the solution by @davidmondok works.

Radiergummi avatar Oct 10 '22 06:10 Radiergummi

Thanks David. This issue is tracked in:

  • https://github.com/sindresorhus/np/issues/592

fregante avatar Feb 03 '23 12:02 fregante