Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Building Node.js gives error: Node.js configure error: No acceptable C compiler found

While trying to use a Ubuntu 14.04 system to cross compile Node.js v0.10.30 for ARM (Raspberry Pi B), I'm experiencing an error message:

Node.js configure error: No acceptable C compiler found!

        Please make sure you have a C compiler installed on your system and/or
        consider adjusting the CC environment variable if you installed
        it in a non-standard prefix.

How should I fix this problem and compile node.js successfully?

Commands used on a fresh Ubuntu 14.04 x64 installation:

sudo apt-get install gcc g++ git

git clone git://github.com/joyent/node.git
cd node
git checkout v0.10.30-release

export AR=arm-unknown-linux-gnueabi-ar
export CC=arm-unknown-linux-gnueabi-gcc
export CXX=arm-unknown-linux-gnueabi-g++
export LINK=arm-unknown-linux-gnueabi-g++

./configure --without-snapshot --dest-cpu=arm --dest-os=linux
like image 909
Nyxynyx Avatar asked Aug 06 '14 21:08

Nyxynyx


1 Answers

I ran into this error as well after trying to run ./configure in my node directory. Here are the commands I ran to get node working for me on an ubuntu server:

  1. cd .. (back to directory where node directory was created)
  2. sudo apt-get install build-essential
  3. cd node/
  4. ./configure
  5. make (For relative newbies, like me, this step took awhile to complete, so don't freak out too much if that happens for you)
  6. sudo make install

Then try running your node file from it's directory. As a small aside, I also got the following error when doing that:

Error: ENOENT, stat '/home/ubuntu/local' at Error (native)

To fix that, I just ran: sudo npm install -g npm

like image 108
Ashley McKemie Avatar answered Sep 30 '22 19:09

Ashley McKemie