centos安装node.js
2013-08-21 17:31
459 查看
确保安装了python,大部分安装失败都是由于python版本过低导致。安装之前,升级python版本,升级步骤 http://www.tomtalk.net/wiki/Python。
[root@SNDA-192-168-15-161 ~]# python -V
Python 2.7.3
开始安装:
1、安装node.js--v0.11.5
2、测试
创建hello.js文件,内容如下:
[root@SNDA-192-168-15-161 ~]# python -V
Python 2.7.3
开始安装:
1、安装node.js--v0.11.5
wget http://nodejs.org/dist/v0.11.5/node-v0.11.5.tar.gz tar -zxvf node-v0.11.5.tar.gz ./configure make && make installmake && make install 时间会稍微长一点
2、测试
创建hello.js文件,内容如下:
var http=require('http'); http.createServer(function(req,res){ res.writeHead(200,{'Content-type':'text/plain'}); res.end('hello world\n'); }).listen(8001,'192.168.8.204'); console.log('Server running at ' target='_blank'>http://192.168.8.204:8001');[/code]
运行:node hello.js
在浏览器里输入 http://192.168.8.204:8001/,可以看到 "hello world"字样
注:监听IP地址(192.168.8.204)可以省略
相关文章推荐
- Centos6.4中安装node.JS
- Linux(centos6.0)下安装Node.js以及使用
- CentOS安装Node.js
- Linux--CentOS-安装Node.js
- CentOS下快捷安装Node.js
- CentOS 安装NodeJS V8.0.0
- node.js源码包安装 centos6.4 x86_64
- CentOS 7安装node.js
- CentOS一些操作命令及node.js安装
- centOS 6.x 版本安装 node.js 4.x 以上版本的方法
- centos 安装node.js
- CentOS 下安装 Node.js
- centos 下安装 node.js
- 在CentOS5.6上安装Node.js
- CentOS 下安装 git + node.js
- CentOS7源码安装node.js和webSocket
- CentOS 下安装 Node.js
- 搭建阿里云环境 - 阿里云 centOS 如何安装 node.js
- Centos上安装nginx+nodejs+express+mongodb环境.
- node.js ——centos爬坑node.js安装、全局环境配置、pm2安装