Mac Os 安装 node.js
2014-10-23 14:34
423 查看
打开控制台,运行以下代码:
[plain] view
plaincopy
git clone git://github.com/ry/node.git
cd node
./configure
make
sudo make install
测试是否安装成功:
写一个Hello Node.js!
[javascript] view
plaincopy
var http = require('http');
http.createServer(function (req, res) {
res.writeHead(200, {'Content-Type': 'text/plain'});
res.end('Hello Node.js\n');
}).listen(8124, "127.0.0.1");
console.log('Server running at http://127.0.0.1:8000/');
输入以下命令:
[javascript] view
plaincopy
> node hello_node.js
Server running at http://127.0.0.1:8000/
如果安装成功访问 http://127.0.0.1:8000/ 是可以看到nodejs安装成功的界面。
[plain] view
plaincopy
git clone git://github.com/ry/node.git
cd node
./configure
make
sudo make install
测试是否安装成功:
写一个Hello Node.js!
[javascript] view
plaincopy
var http = require('http');
http.createServer(function (req, res) {
res.writeHead(200, {'Content-Type': 'text/plain'});
res.end('Hello Node.js\n');
}).listen(8124, "127.0.0.1");
console.log('Server running at http://127.0.0.1:8000/');
输入以下命令:
[javascript] view
plaincopy
> node hello_node.js
Server running at http://127.0.0.1:8000/
如果安装成功访问 http://127.0.0.1:8000/ 是可以看到nodejs安装成功的界面。
相关文章推荐
- Node.js安装及常用命令(Mac OS )
- 在Mac OS上安装使用Node.js的项目自动化构建工具Gulp
- mac os 10.12.5安装node.js
- Ubuntu 安装node.js
- 如何安装Node.js
- 虚拟机下的CentOS环境中安装Node.js
- Redis加Node.js的全文搜索引擎 Reds在Ubuntu下面 的安装
- 在windows 7下安装node.js
- 在Windows平台上安装Node.js及NPM模块管理
- 详解如何在ubuntu上安装node.js
- Node.js 安装及npm的安装
- 在windows 下安装node.js
- [转]各种系统安装Node.js
- Node.js 安装及npm的安装
- 安装node.js
- 在CentOS5.6上安装Node.js
- node.js安装
- linux 安装node.js
- 如何安装Node.js
- 在Ubuntu 上安装node.js