在尝试使用 Ubuntu 14.04 系统交叉编译 Node.js v0.10.30 for ARM (Raspberry Pi B) 时,我遇到错误消息:
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.
如何解决这个问题并成功编译 node.js?
在全新的 Ubuntu 14.04 x64 安装上使用的命令:
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
最佳答案
尝试在我的 Node 目录中运行 ./configure 后,我也遇到了这个错误。以下是我运行的命令,让 Node 在 ubuntu 服务器上为我工作:
- cd ..(回到创建 Node 目录的目录)
- sudo apt-get install build-essential
- cd Node/
- ./配置
- make(对于像我这样的新手来说,这一步需要一段时间才能完成,所以如果您遇到这种情况,请不要 panic )
- sudo 进行安装
然后尝试从它的目录运行你的 Node 文件。顺便说一句,我在这样做时也遇到了以下错误:
错误:ENOENT,stat '/home/ubuntu/local' 出错时( native )
为了解决这个问题,我运行了:sudo npm install -g npm
关于node.js - 构建 Node.js 出现错误 : Node. js 配置错误:找不到可接受的 C 编译器,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/25170492/