CentOS 下安装 git + node.js
2012-08-03 09:12
555 查看
首先编译 git 以便可以 clone node.js
最新版git可以在 http://git-scm.com/download 下找到
wget http://kernel.org/pub/software/scm/git/git-1.7.4.1.tar.bz2
tar -xjf git-1.7.4.1.tar.bz2
cd git-1.7.4.1.tar.bz2/
./configure
make
make install
截下来下载并编译 node.js
git clone git://github.com/joyent/node.git
cd node/
./configure
make
make install
As NodeJS v0.4.0 is out, I thought I’d have a play around with it (something I haven’t done in a very long time!)
Instantly I ran into problems:
I’m trying to install this on my Arch Desktop, which has Python version 3.1.3 installed. After
some
research I found that it was a compatibility issue between Python 2.x and 3.x.
I didn’t really want to remove Python 3 as I’d had
dependency
hell
recently. Inspired by an
answer on StackOverflow, I had a dig about in my /usr/bin directory to see if there was both Python v3
and Python v2 installed. Fortunately there was: /usr/bin/python2
After some trial and error, all I had to do was to edit 2 files:
/tmp/node-v0.4.0/tools/waf-light
amending the first line to read:
and once I had run ./configure edit the first line in the Makefile to read:
Simple!
Now I have Node JS version 0.4.0 running on my Arch box.
接下来可以试试看 node.js 提供的http server的例子
var http = require('http');
http.createServer(function (req, res) {
res.writeHead(200, {'Content-Type': 'text/plain'});
res.end('Hello World\n');
}).listen(8124, "127.0.0.1");
console.log('Server running at http://127.0.0.1:8124/');
保存为 test.js
然后执行 node test.js
最新版git可以在 http://git-scm.com/download 下找到
wget http://kernel.org/pub/software/scm/git/git-1.7.4.1.tar.bz2
tar -xjf git-1.7.4.1.tar.bz2
cd git-1.7.4.1.tar.bz2/
./configure
make
make install
截下来下载并编译 node.js
git clone git://github.com/joyent/node.git
cd node/
./configure
make
make install
As NodeJS v0.4.0 is out, I thought I’d have a play around with it (something I haven’t done in a very long time!)
Instantly I ran into problems:
$ ./configure Traceback (most recent call last): File "/Users/greim/nodestuff/node/tools/waf-light", line 157, in import Scripting File "/Users/greim/nodestuff/node/tools/wafadmin/Scripting.py", line 146 except Utils.WafError, e: ^ SyntaxError: invalid syntax
I’m trying to install this on my Arch Desktop, which has Python version 3.1.3 installed. After
some
research I found that it was a compatibility issue between Python 2.x and 3.x.
I didn’t really want to remove Python 3 as I’d had
dependency
hell
recently. Inspired by an
answer on StackOverflow, I had a dig about in my /usr/bin directory to see if there was both Python v3
and Python v2 installed. Fortunately there was: /usr/bin/python2
After some trial and error, all I had to do was to edit 2 files:
/tmp/node-v0.4.0/tools/waf-light
amending the first line to read:
#!/usr/bin/env python2
and once I had run ./configure edit the first line in the Makefile to read:
WAF=python2 tools/waf-light
Simple!
Now I have Node JS version 0.4.0 running on my Arch box.
接下来可以试试看 node.js 提供的http server的例子
var http = require('http');
http.createServer(function (req, res) {
res.writeHead(200, {'Content-Type': 'text/plain'});
res.end('Hello World\n');
}).listen(8124, "127.0.0.1");
console.log('Server running at http://127.0.0.1:8124/');
保存为 test.js
然后执行 node test.js
相关文章推荐
- CentOS下快捷安装Node.js
- CentOS下安装Node.js
- centos安装node.js
- Centos6.4中安装node.JS
- Ubutu git 安装node.js
- CentOS 7.X 安装 node.js和 cnmp vue
- Centos 7.2 Node.js 安装
- CentOS安装Node.js
- Centos上安装nginx+nodejs+express+mongodb环境.
- Centos6.8 下 Node.js 的安装
- Windows下安装node.js(npm) git+vue
- centos/linux 安装node.js
- CentOS安装Node.js
- node.js v0.10.31二进制包安装(centos6.4 x86_64)
- CentOS安装Node.js、Express和Socket.io
- Centos 安装Node.js
- 在 CentOS 上安装 node.js
- centOS下通过NPM安装和配置node.js+socket.io+connect在线聊天的详细教程
- CentOS下编译安装Node.js 5.1.0
- Centos6.5 安装 node.js