sindresorhus / np

A better `npm publish`
MIT License
7.53k stars 298 forks source link

np command extremely slow #717

Open jonesy-b-dev opened 11 months ago

jonesy-b-dev commented 11 months ago

Description

When i run the np command it useally takes like 3 minutes or more before something pops up on the screen. sometimes it just doesnt work at all and I have to re run it.

Why does this take so long

Steps to reproduce

  1. run the np command

Expected behavior

See Something happening quickly

Environment

np - 8.0.4 Node.js - 18.18.0 npm - 10.1.0 Git - 2.42.0 OS - Win 10 Pro 1909

bwp91 commented 11 months ago

As I am having a similar issue, wanted to reply here just to subscribe to any other replies.

I don't necessarily mean to hop on the bandwagon - I have used np for a long time with no issues, just today it seems to be playing up but I simply have been putting this down to npm issues rather than anything to do with this package.

By 'playing up' I mean stalling on the ⠸ Publishing package using npm (waiting for input…) step, when I enter my OTP it seems to hang, hence my assumption that it is something to do with npm.

sindresorhus commented 11 months ago

I noticed this too recently that np would hang for a long time when running $ np. I haven't yet figured out what causes it.

sindresorhus commented 11 months ago

By 'playing up' I mean stalling on the ⠸ Publishing package using npm (waiting for input…) step, when I enter my OTP it seems to hang, hence my assumption that it is something to do with npm.

This sounds like a different issue. My guess would be that the npm CLI wants input we didn't anticipate. For example, sometimes I wants you to press Space to open the browser to authenticate there. I don't think we handle that case.

jonesy-b-dev commented 11 months ago

A quick fix for it is often to just restart the cmd, so it might be related to a cmd windows that had previous commands or is open for a long time. It sounds weird but I have no idea what else it could be. On a new cmd window it works always pretty quickly

bwp91 commented 11 months ago

The issue in my case was that npm happened to be having issues at the time 😰 so no more issues on my end since :)

jonesy-b-dev commented 11 months ago

@bwp91 interesting, did you just update npm? did it got fixed after that?

jonesy-b-dev commented 10 months ago

Wanted to use np again but it just stopped working. Was able to make a release today but after that it just didn't work. Doesn't matter how often I retry, this really should be investigated if more people have this issue