TL;博士:我试图安装在我的基于ARMv7的-node.js的Cubox运行Ubuntu 12.10(量子)。 当从源代码编译的node.js(见“第二次尝试”下方), node
产生一个段故障。 我能做些什么吗?
第一次尝试
首先,我试图通过包管理器安装的node.js,紧接着在这里给出的Ubuntu的说明: 通过包管理器安装的Node.js:Ubuntu的,薄荷
使用添加有提到库sudo add-apt-repository ppa:chris-lea/node.js
似乎很好地工作:
You are about to add the following PPA to your system:
Evented I/O for V8 javascript. Node's goal is to provide an easy way to build scalable network programs
More info: https://launchpad.net/~chris-lea/+archive/node.js
Press [ENTER] to continue or ctrl-c to cancel adding it
gpg: keyring `/tmp/tmpp0owib/secring.gpg' created
gpg: keyring `/tmp/tmpp0owib/pubring.gpg' created
gpg: requesting key C7917B12 from hkp server keyserver.ubuntu.com
gpg: /tmp/tmpp0owib/trustdb.gpg: trustdb created
gpg: key C7917B12: public key "Launchpad chrislea" imported
gpg: Total number processed: 1
gpg: imported: 1 (RSA: 1)
OK
然而, sudo apt-get install nodejs
给我的错误:
E: Unable to locate package nodejs
我想这是因为我有一个基于ARM的系统。 至于我可以告诉从包装细节 ,只包含回购建立i386和amd64。 是我的假设吗?
第二次尝试
所以,我的下一个尝试是从源代码安装的node.js。 我用下面的要点给出的说明: 在30秒的Node.js和NPM 。 一切似乎都工作,包括make install
。 但是,执行install.sh
因为在要点的最后一行脚本失败node
产生分段错误。 现在我不知道我能做些什么来正确安装在我的机器上的node.js?
为了说明我的问题,这里是一些输出:
install.sh输出
这是的输出中install.sh
运行后make install
,如在上面提到的要旨安装说明。
cyroxx@cubox:~/node-latest-install$ curl https://npmjs.org/install.sh | sh
% Total % Received % Xferd Average Speed Time Time Time Current
Dload Upload Total Spent Left Speed
100 7882 100 7882 0 0 11251 0 --:--:-- --:--:-- --:--:-- 14984
tar=/bin/tar
version:
tar (GNU tar) 1.26
Copyright (C) 2011 Free Software Foundation, Inc.
License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html>.
This is free software: you are free to change and redistribute it.
There is NO WARRANTY, to the extent permitted by law.
Written by John Gilmore and Jay Fenlason.
install npm@latest
fetching: http://registry.npmjs.org/npm/-/npm-1.2.21.tgz
Segmentation fault
Segmentation fault
You need node to run this program.
node --version reports: v0.10.7
Please upgrade node before continuing.
It failed
节点输出
cyroxx@cubox:~/node-latest-install$ node
Segmentation fault
使调试版本
运行make
与BUILDTYPE=Debug
产生这样的输出:
cyroxx@cubox:~/node-latest-install$ make -C out BUILDTYPE=Debug
make: Entering directory `/home/cyroxx/node-latest-install/out'
CXX(target) /home/cyroxx/node-latest-install/out/Debug/obj.target/v8_base/deps/v8/src/arm/stub-cache-arm.o
../deps/v8/src/arm/stub-cache-arm.cc: In function 'void v8::internal::ProbeTable(v8::internal::Isolate*, v8::internal::MacroAssembler*, v8::internal::Code::Flags, v8::internal::StubCache::Table, v8::internal::Register, v8::internal::Register, v8::internal::Register, v8::internal::Register, v8::internal::Register, v8::internal::Register)':
../deps/v8/src/arm/stub-cache-arm.cc:106:15: error: comparison of unsigned expression < 0 is always false [-Werror=type-limits]
cc1plus: all warnings being treated as errors
make: *** [/home/cyroxx/node-latest-install/out/Debug/obj.target/v8_base/deps/v8/src/arm/stub-cache-arm.o] Error 1
make: Leaving directory `/home/cyroxx/node-latest-install/out'
什么是错在这里? 这是V8的ARM实现中的错误? 也许所有的编译器标志不在(正确)设置? 还要别的吗? 我完全卡住。