Node.js creating bad_alloc

I'm trying to start using node.js mainly for training purposes, but I definitely see some potential that I will use in future projects.

My problem. I use SSH on my Centos server and went through this lesson: https://www.digitalocean.com/community/articles/how-to-install-and-run-a-node-js-app-on-centos-6- 4-64bit

Everything stopped before the section "Creating an express application". When I type "express hello" in my command line, I get this error:

terminate called after throwing an instance of 'St9bad_alloc' what(): std::bad_alloc Aborted (core dumped) 

Then there will be a file in the directory (example: core.1233), which appears to contain jargon, but definitely has not been there before.

I also went to http://nodejs.org and tried to just create a simple web server with code there. I create an example.js file, and when I type "node example.js", I also get:

 terminate called after throwing an instance of 'St9bad_alloc' what(): std::bad_alloc Aborted (core dumped) 

... as before.

I am a programmer (usually PHP, MySQL, etc.), the bud does not work much on the server or on the command line, but I can get around quite well. The problem is that I don’t know what this means, besides what Google quick search says - something in common with memory? Any help is generally much appreciated!

(Also, when I print "node --version", I get version v0.10.8, so I'm sure that node was installed correctly. If I create an example.js file, I ONLY say "console" .log ('test' ); ", it still ends and gives the same error. It never gives out.)

Thanks!

+6
source share
1 answer

I had the same problem on my CentOS server. The main problem for me is a lack of memory. There is only 384 MB of RAM on the server, and this, of course, is not enough to run both mongodb and node on the same server. When I have a monogdb function running in the background, I get this error when I try to start my node server. But when I turn off the mongodb service, I do not get this error. Of course, this is pretty useless because my node application requires mongodb to run.

0
source

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


All Articles