Node.js program freezes on Amazon linux server

I have an ubuntu server on Amazon and I'm trying to run node.js. The program has only one line:

console.log('Here I am.'); 

Nothing happens, and the program does not exit.

when I run ps x, I can see one [node] process in STAT D state:

  751 ? D 0:04 [node] 

The process cannot be stopped with sudo kill -9 751.

Before the problem, the node.js program went fine, as did my actual - much more complex - node.js program.

I even rebooted the ubuntu server and tried to run the node.js single-line test program right after the reboot. He hung and did not output anything.

node --version returns

 v0.7.6-pre 

Any ideas why this is happening? Is this a problem with an Amazon instance, installing node.js, or something else? nginx works fine on a single server, but node.js programs freeze as described above.

(as expected, the same code works very well on my local mac os x environment)

UPDATE: I will go back to stable version 0.6.12, but the same problem persists.

+4
source share
2 answers

The problem is solved (view).

It's a secret. I created a new instance on Amazon EC2 ("identical" to the one I had), installed git, nginx, node.js and my node.js. Now everything is working correctly.

Something must have happened to the instance I had. I just don't understand what it was, but since I had nothing important, I just dumped it.

Maybe the cause of this problem was version 0.7.6-pre, which I originally pulled out and compiled. Perhaps there were some errors from this installation that caused peculiar behavior.

+1
source

Just for someone else who is facing this problem, it could be related to this:

"After using yum to upgrade to Amazon Linux AMI 2011.09, t1.micro 32-bit instances cannot reboot."

Updating "AKI" in my instance seems to fix the issue for me.

+1
source

Source: https://habr.com/ru/post/1400757/


All Articles