6

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

My problem - I'm using SSH on my Centos server and have gone through this tutorial: https://www.digitalocean.com/community/articles/how-to-install-and-run-a-node-js-app-on-centos-6-4-64bit

Everything went great until the "Creating an express app" section. When I type "express hello" on 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) that appears to have jargon in it - but definitely was not there before.

I also went to the http://nodejs.org website and attempted to just create the simple web server with the code there. I create the 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)

...just as before.

I'm a programmer (typically PHP, MySQL, etc), bud don't work much ON the server or at command line - but I can "get around" well enough. Problem is - I have no clue what this means other than what a quick google search tells me - something to do with memory? Any help at all is greatly appreciated!

(Also, when I type "node --version" I do get the version v0.10.8 so I am pretty sure node was installed correctly. If I create the example.js file to ONLY say "console.log('test');", it still terminates and gives the same error. It never outputs.)

Thanks!

kdm5157
  • 61
  • 4

1 Answers1

0

I've been having the same problem as well on my CentOS server. The main issue for me is lack of memory. The server only has 384 MB of RAM and this is certainly not enough to run both mongodb and node on the same server. When I have monogdb service running in the background, I get this error when I try to run my node server. But when I switch off the mongodb service, I don't get this error. Ofcourse then, it's pretty useless because my node application requires mongodb to be running.

adi2412
  • 51
  • 3