node官网上可以下载linux的二进制版本Linux Binaries (.tar.gz),这个版本下载下来在linux上解压后,怎么运行啊? 到解压后的bin下面直接运行node不行: [gimap@cnsh041415 bin]$ node -bash: node: command not found
[gimap@cnsh041415 bin]$ ./node
./node: /lib64/libc.so.6: version GLIBC_2.9' not found (required by ./node) ./node: /lib64/libc.so.6: versionGLIBC_2.6’ not found (required by ./node)
./node: /lib64/libc.so.6: version `GLIBC_2.7’ not found (required by ./node)
[gimap@cnsh041415 bin]$ Linux Binaries (.tar.gz)
注意看 readme... 应该还是要编译的
Evented I/O for V8 javascript. Build Status
To build:
Prerequisites (Unix only):
* Python 2.6 or 2.7
* GNU Make 3.81 or newer
* libexecinfo (FreeBSD and OpenBSD only)
Unix/Macintosh:
./configure
make
make install
Windows:
vcbuild.bat
To run the tests:
Unix/Macintosh:
make test
Windows:
vcbuild.bat test
To build the documentation:
make doc
To read the documentation:
man doc/node.1
Resources for Newcomers
二进制版本没有 ./configure 吧? http://nodejs.org/dist/v0.8.14/node-v0.8.14-linux-x64.tar.gz
@xuhaijinsky2008 呃, 你是对的 你下载的版本和我一样的么? http://nodejs.org/dist/v0.8.14/node-v0.8.14-linux-x86.tar.gz
➤➤ cd node-v0.8.14-linux-x86/
➤➤ ls
bin ChangeLog include lib LICENSE README.md share
➤➤ cd bin/
➤➤ ls
node node-waf npm
➤➤ ./node -v
v0.8.14
➤➤ ./node
> console.log('fine')
fine
undefine
@jiyinyiyong 呵呵,我运气没那么好了,得出来个
[gimap@cnsh041415 bin]$ ./node -v
./node: /lib64/libc.so.6: version GLIBC_2.9' not found (required by ./node) ./node: /lib64/libc.so.6: versionGLIBC_2.6’ not found (required by ./node)
./node: /lib64/libc.so.6: version `GLIBC_2.7’ not found (required by ./node)
估计还是环境有问题。
我没有root权限,下载安装了python2.7.3后(原来是2.4.3),把当前用户的环境变量改成了python2.7.3在前面。
@jiyinyiyong 我拿源码过来make也报错。
Traceback (most recent call last): File ".../.../tools/js2c.py", line 36, in <module> import bz2 ImportError: No module named bz2 make[1]: *** [/wls/gimap/soft/node-v0.8.14/out/Release/obj/gen/libraries.cc] Error 1 make[1]: Leaving directory `/wls/gimap/soft/node-v0.8.14/out’ make: *** [node] Error 2 [gimap@cnsh041415 node-v0.8.14]$ ls
export PATH=$PATH:/your/node/dir/bin export LD_LIBRARY_PATH=LD_LIBRARY_PATH:/your/node/dir/lib