Take the 2-minute tour ×
Server Fault is a question and answer site for professional system and network administrators. It's 100% free, no registration required.

I want to install node.js on CentOS

  • unfortunately i'm having trouble installing gcc (and all of the things that generally come with it in order to get node to even compile) on centOS via commandline.

What I've tried so far

  • sudo yum install gcc I get the following error
Downloading Packages:
Running rpm_check_debug
Running Transaction Test
memory alloc (8 bytes) returned NULL.

and yes I have set the ulimit prefs to 'unlimited'.


  • I have also attempted installing the depencies individually although this was only possible with a couple whereas the rest (i.e glibc) require to install with dependencies and give me the same error: memory alloc (8 bytes) returned NULL..

  • I have also attempted installing the rpm's of individual dependencies (i.e glibc) however rpm throws the same error of memory alloc (8 bytes) returned NULL. which was pretty annoying.

What I have deduced

  • I think (and hope) it may be a simple preferences issue, since i am able to install smaller files ( <10mb or something ) without error.
share|improve this question
    
How much memore do you have free? –  Lucas Kauffman Jul 28 '12 at 9:59
1  
Wow, that's a badly broken system. –  womble Jul 28 '12 at 10:00
1  
@mikeymeows: ServerFault is for system administrators. If you don't have root access then your not a sysadmin (for this host) and there is little we can do to help you. This answer on our meta explains this. All you can really do is contact the people who do have root access and get them to aid you. –  Iain Jul 28 '12 at 10:51
3  
It is at this point that the professional sysadmin would make a report to decision makers describing the impossibility of the task, and suggesting alternate courses of action. –  womble Jul 28 '12 at 11:12
1  
@mikeymeows Can't you "sudo -s" ? –  adamo Jul 28 '12 at 14:10
show 7 more comments

4 Answers

Honestly? In a situation like you're in, too little RAM, one of the options you need to explore is to do the compile on some other system and then bring the results to your resource-constrained server. This is what installing an RPM actually is, and you can do a similar thing without learning how to package RPMs.

  1. On a system with more resources, configure it the same as you would your wee VPS. Hardware will be different, but I don't believe that matters for node.js
    • This can be as simple as running CentOS 6.3 in VirtualBox on your laptop, or spending a few hours on a cloud-provider for a larger instance-type and doing it there.
  2. Compile node.js
    • Run the configure & make, but do NOT do make install yet.
  3. Tar up the compiled directory
  4. Transfer to your wee VPS & extract
  5. Run make install.

This should work since install scripts are typically more concerned with moving files around than they are compiling stuff, and are therefore rather RAM-light.

share|improve this answer
    
i had already begun doing this haha, I didn't really want to end up doing this but it seems like my last resort. Thanks for the answer though :) –  Michael Zaporozhets Jul 28 '12 at 14:22
    
this didn't work at all; but i've resorted to an amazon ec2 instance –  Michael Zaporozhets Jul 31 '12 at 4:46
add comment

You are on openvz which leads to me to suspect the host is being oversold. Because you cant have swap on it there normally should be burstable memory to catch a temporarily shortcome of memory. This is a known issue with openvz, but which it's not problematic unless the host has too many vms.

You will need to either order extra memory for your instance or just move the vps elsewhere.

share|improve this answer
add comment

One of the many annoyances I'd long since forgotten about, since I absolutely refuse to ever use OpenVZ for anything. Ever.

If you must use a VPS, use one based on KVM, VMware or Xen. (Listed in order of my personal preference.)

Back when I was stuck babysitting servers on these crappy little VPSes, I could get around this error by disabling plugins. For example:

yum --disableplugin=fastestmirror groupinstall "Development Tools"

Though sometimes that wasn't even enough, and I'd have to shut down running services to free up enough RAM to install packages. Let me tell you, THAT was fun.

share|improve this answer
1  
Never say never. One day you might be down on your luck and need to make a quick buck, and your choices might be either selling an organ or selling oversubscribed, underprovisioned bargain-basement VPSes to people who don't have the knowledge to understand they're being screwed... well, you can live with only one kidney, right? –  womble Jul 28 '12 at 21:25
    
There are just some lines I won't cross. Besides, I know how to oversubscribe KVM VPSes. ;) –  Michael Hampton Jul 28 '12 at 21:28
2  
But OpenVZ is so much more oversubscribable... they should make it one of their marketing points... "OpenVZ is 3x more oversubscribable than the competition!" –  womble Jul 28 '12 at 23:39
    
And the poor folks will only notice once they try to go over their memory, and what's the solution, buy even MORE overpriced memory of us!? insert evil laugh here –  Lucas Kauffman Jul 29 '12 at 0:46
    
Actually the latest vesrion of OpenVZ has a fix for this. They call it vSwap. It lets the VPS use even more RAM than has been allocated (and it apparently shows up in the VPS as swap space) but then it slows down the VPS's execution to simulate the speed decrease of swapping. Combine that with an actually swapping host and you've got a VPS disaster. –  Michael Hampton Jul 29 '12 at 1:42
show 3 more comments

It seems that your machine needs a lot more memory than what it currently has available in order to work. So try adding (even temporarily) enough swap space and try again.

share|improve this answer
2  
He can't add swap, it's an OpenVZ VM. –  womble Jul 28 '12 at 10:28
    
^this, i don't have root access :c –  Michael Zaporozhets Jul 28 '12 at 10:32
    
@womble Thanks. I had not noticed it was an OpenVZ host when I answered. –  adamo Jul 28 '12 at 12:57
1  
I find the 0kB for cache/buffers sticks out like a rat's bollocks. –  womble Jul 28 '12 at 13:11
    
@womble that joke was drier than a dead dingo's donger:p –  Lucas Kauffman Jul 29 '12 at 0:43
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.