Nyxynyx
Nyxynyx

Reputation: 63619

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

Upvotes: 7

Views: 14883

Answers (3)

user3109582
user3109582

Reputation: 81

Install the build essential using the below commands, these will install gcc as well. It worked for me. Let me know if this works for you.

sudo apt update
sudo apt install build-essential

Upvotes: 2

Wellwisher1348
Wellwisher1348

Reputation: 1

I was required to use: sudo apt-get install npm -g -y in my WSL, VSCode Windows terminal.

Upvotes: 0

Ashley McKemie
Ashley McKemie

Reputation: 179

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

Upvotes: 10

Related Questions