NodeJS For Windows
2012-03-02 15:13
507 查看
概述
NodeJS是一个Javascript运行环境(runtime)。它是对V8引擎的封装。它采用了“事件循环”架构,并使用非阻塞库支持此架构。它适用于数据敏感、实时性网络应用程序。相关信息请猛击此处: http://nodejs.org/。
NodeJS在github上的地址:https://github.com/joyent/node。
安装
如果源码安装,请安装如下依赖:l Python – version 2.6 / 2.7
l Libssl-dev – 如果你计划使用SSL/TLS加密,你需要安装这个。
Windows
需要python和Microsoft Visual Studio,但不需要OpenSSL。在cmd.exe中做如下操作:我安装了python-2.6.6,下载地址为:http://www.python.org/getit/releases/2.6.6/。
Tar工具的下载地址为:http://gnuwin32.sourceforge.net/packages/gtar.htm。
VS要求是2010。。。。。
C:\Users\ryan>tar -zxf node-v0.6.5.tar.gz C:\Users\ryan>cd node-v0.6.5 C:\Users\ryan\node-v0.6.5>vcbuild.bat release [Wait 20 minutes] C:\Users\ryan\node-v0.6.5>Release\node.exe > process.versions { node: '0.6.5', v8: '3.6.6.11', ares: '1.7.5-DEV', uv: '0.6', openssl: '0.9.8r' } >
看到以上信息后,说明成功安装。
0.6以上的版本中包含了npm,所以,不需要单独安装。
验证
在成功build完nodejs后,让我们运行下helloworld.js程序。Helloworld.js内容如下:
var http = require('http'); http.createServer(function (request, response) { response.writeHead(200, {'Content-Type': 'text/plain'}); response.end('Hello World\n'); }).listen(8124); console.log('Server running at ' target='_blank'>http://127.0.0.1:8124/');[/code]
打开cmd,当前目录为node.exe所在目录,执行下面命令:node helloworld.js
然后,在浏览器中输入地址:http://127.0.0.1:8124/。页面内容为Hello World。
相关文章推荐
- NodeJS for Windows
- nodejs for windows
- 安装选择构筑RubyMine IDE开发工具的Coffeescript+node.js开发环境(for windows)
- 安装node.js+express for windows的Web开发环境
- 构筑RubyMine IDE开发工具的Coffeescript+node.js开发环境(for windows)
- Node Sass could not find a binding for your current environment: Windows 64-bit with Node.js 7.x
- 构筑RubyMine IDE开发工具的Coffeescript+node.js开发环境(for windows)
- 安装node.js+express for windows的Web开发环境
- NodeJS for Windows 安装
- A chatroom for all! Part 1 - Introduction to Node.js(转发)
- 初步NodeJS in Windows:从安装到入门
- windows版的node.js简单示例
- node.js在windows下的学习笔记(1)---安装node.js
- 在windows环境下基于sublime text3的node.js开发环境搭建
- windows下sublime text的node.js开发环境搭建
- Windows平台下的node.js安装
- 一、windows下安装node.js+express
- Windows下Node.js开发入门(1)
- node.js程序作为服务并在windows下开机自启动(用forever)
- Spotlight – Recommend Node.js Projects For January