12

I'm having a weird issue.

I'm trying to set up a project I downloaded. The project is a web application with server components in Node.js and client components in Angular.

When I do things like npm install in command prompt, it just freezes at _, until I hit CTRL+C, when it resumes and everything executes succesfully.

This is really strange. Any ideas why this is happening?

CodyBugstein
  • 21,984
  • 61
  • 207
  • 363
  • 4
    If this is windows, if you select something in the cmd window while it is running it will pause (not show more display) until you clear that. This will happen via ctrl+c or by hitting enter – Brocco Dec 01 '14 at 14:17
  • is it waiting for some input? tried hitting enter? – Marc B Dec 01 '14 at 14:18
  • Can you perhaps show a little more of the output leading up to the freeze? A single underscore is not a lot to go by. – Danny Staple Dec 01 '14 at 14:26
  • @MarcB yes, hitting `Enter` also makes it continue – CodyBugstein Dec 01 '14 at 15:03
  • Thanks @ruffin, same solution outlined here - [python program stops in command line](https://stackoverflow.com/questions/24571981/python-program-stops-in-command-line) (caused me much pain ;) ) – rdmolony Apr 29 '22 at 07:48
  • And here - [Sometimes PowerShell stops sending output until I press enter. Why?](https://stackoverflow.com/questions/24571981/python-program-stops-in-command-line) – rdmolony Apr 29 '22 at 09:05

2 Answers2

6

I've had a number of freezes after an npm i that, even if I scorch the node_modules folder & npm cache (rmdir /S /Q node_modules and then npm cache clean --force), can still happen and that don't seem to happen at predictable times.

Here's one possible answer from the nodejs project's github issues pages, edited slightly to match what I see now in Win10:

This "Randomly" hang issue is causing by CMD when you trying to highlight inside of CMD. To resolve this issue:

  1. right click title bar
  2. select Defaults
  3. unselect Quick Edit Mode from the Options tab
  4. reopen CMD

Though note that you don't have to actively highlight anything for npm to stop; I'm going to guess something npm executes is "highlighting" some text as part of its log to the console and that interaction throws off cmd (as Brocco implied in 2014 and ArbitraryChoices seemed to confirm yesterday).

I've given turning off Quick Edit Mode a try with some success. I think the downside is limited to you having have to hit Alt-space, e, k to select text with the mouse like you did before Quick Edit Mode was foisted on us.

ruffin
  • 16,507
  • 9
  • 88
  • 138
3

The answer from ruffin seems to be correct. I experienced the same thing. The ping display would just stop, and then Ctrl-C would make it resume. Turning off Quick-Edit mode solved the problem. However, I should also add:

I never had this issue until recently (that is, early December, 2020). It just started happening, seemingly out of the blue. I did not recently (or ever, that I recall) turn on Quick Edit mode. Therefore, my guess is that a recent Windows Update has changed the settings making Quick Edit on the default setting.

RJBfromNJ
  • 31
  • 1