Version: 8.9.3, 8.9.4, 9.4.0
Platform: Windows 10 64-bit
It may be a simple node --version or an interactive node session, sometimes the node.exe process starts hanging while exiting.
If I rename a part of the path, it works. If I copy the node.exe file to another place, it works.
If I run it in the same path that hanged first, it hangs again. Then the only way is to restart Windows.
Maybe you use some global Windows's object name based on the file path?
What is the path?
First, note that the path not always fail. It starts to fail sometimes.
It was C:\Projeto\trunk\SisWebApp\node\node\node.exe.
When I renamed to C:\Projeto\trunk\SisWebApp\x\node\node.exe or C:\Projeto\trunk\SisWebApp\node\y\node.exe it worked.
Renaming back hangs again.
I think the actual path does not matter, but something that happens when killing a previous process.
That is weird. What do you mean by "it hangs"?
BTW, did you compiled Node yourself or did you download it? Are you using cmd or some other app, like ConEmu?
"Hangs", it doesn't quit. node --version does not end and cannot be interrupted by CTRL+C.
In interactive mode CTRL+C works to tell node to quit, or process.exit(), but then it hangs and CTRL+C again does not kill it. The only way to kill it is by the task manager.
Same thing happens in cmd.exe, calling inside a Java program in Eclipse or from a VSCode task.
Node was downloaded with the frontend-maven-plugin.
Could you try official Node binary - https://nodejs.org/dist/v9.4.0/win-x64/node.exe - and see if this still reproduces?
frontend-maven-plugin downloads node.exe from that place, and in fact, I downloaded it and did a binary compare and the files are identical.
Ok, so, with that binary:
node --version from cmd in C:\Projeto\trunk\SisWebApp\node\node sometimes hangs - Node process will not exit after displaying versionC:\Projeto\trunk\SisWebApp\x\node\ works as intended.Is that correct?
Yes, and when it hangs it hangs in every try until restart machine.
So I see only two possible problems:
The problem happened already two days in my machine and a day in a cowork's machine.
It does not reproduce on that different path, so that would mean C:\Projeto\trunk\SisWebApp\node\node is special in some kind. I have no idea what this could be, I never saw anything like this.
/cc @nodejs/platform-windows
It's not true that it does not reproduce on different paths. That happens because I always starts in that path when the problem appear.
Does this reproduce if you completely disable the antivirus?
Can't reproduce by simply installing node into this path, so it is most likely related to your local setup.
Since last time the problem happened I didn't want to restart, I moved it to C:\Projeto\trunk\SisWebApp\node2\node and still am using from there. Let's see if the problem happens again.
@seishun I cannot disable the antivirus here, but it was configured to not look in C:\Projeto\trunk\... now.
Can you try on a different machine, or in a VM, then? We can't really help if we can't reproduce the issue locally.
@tniessen the problem is not with that path. The problem sometimes happens and from then, the path with was using becomes problematic until restart.
@seishun isn't there a special build or option that logs everything possible when exiting the process?
Not really, but you can try attaching to the node process with a debugger to see what's going on. The pdb file is available here: https://nodejs.org/dist/v9.4.0/win-x64/
I will generate a process dump in the next time.
The problem happened again, now with path C:\Projeto\trunk\SisWebApp\node2\node\node.exe. I'm attaching a dump from a simple node --version. This is for x64 version v8.9.3.
node.zip
I see wslbscrwh64.dll in the dump, which is not usual. It would seem it is this thing: http://www.dieboldnixdorf.com.br/warsaw. Is this correct?
Yes, we need this thing here to access internet banking. And it already caused us some problems with another application, but not when quitting the process.
Could you check if this is causing the issue?
I confirm the culprit is warsaw. I just uninstalled it (while node was hanging) and even without restart, node stop to hang.
I understand that if you close this I cannot complain, but if some change or workaround from node would be possible it would be very great, as it is pretty difficult to live in Brazil without that warsaw application that I call as a virus.
Thank you for investigating. It's very unlikely that any collaborator will look into this, so closing.
If you can come up with a workaround that doesn't make the code more complex, you're welcome to submit a PR.
@asfernandes Wow, thanks, it really was Warsaw! I never asked it to install and I always see if a software installs others to disable it (installing others that I don't want), but some software must have installed Warsaw without my consent (I don't use this machine for accessing bank accounts, so I don't know what installed Warsaw).
When I ran node -v, it showed v8.9.4 and than hanged. When I ran npm -v (or any npm command) it simply hanged (without doing nothing). Sometimes with npm, if I ended the node process it worked for the hanging process (but hanged the next time the command was executed).
When I installed npm and node again the problem was solved, then in the next day it returned.
Uninstalling Warsaw solved it imediatelly :+1:
Like you said, it would be great a workaround from node, but from the comment of @seishun, it seems unlikely. At least it seems I won't have this weird issue again.
@lucasbasquerotto exactly as the problem I have.
Thanks @asfernandes you were a life saver.
Most helpful comment
I confirm the culprit is warsaw. I just uninstalled it (while node was hanging) and even without restart, node stop to hang.
I understand that if you close this I cannot complain, but if some change or workaround from node would be possible it would be very great, as it is pretty difficult to live in Brazil without that warsaw application that I call as a virus.