windows下Node.js 的安装

1. 到http://nodejs.org/下载并编译,支持Linux、Mac,也支持windows下的Cygwin。

Windows: 

1. windows下 要先安装  cygwin

   install  cygwin

   安装步骤:

 

    1. 下载 setup.exe   from www.cygwin.com.

    2. 运行setup.exe.

    3. 选择下一步

 


4.选择 "Install from Internet" 并点击 下一步.

5.Enter preferred installation (Root) directory and click next.

6. Enter a temporary installation directory and click next.

7. Select "Direct Connection" and click next.

8.Select a download site and click next. 

9. Select the packages you want to install and click next.
Packages you may want to install include:

Devel
  • gcc-g++: C++ compiler
  • gcc-mingw-g++: Mingw32 support headers and libraries for GCC C++
  • gcc4-g++: G++ subpackage
  • git: Fast Version Control System – core files
  • make: The GNU version of the ‘make’ utility
  • openssl-devel: The OpenSSL development environment
  • pkg-config: A utility used to retrieve information about installed libraries
  • zlib-devel: The zlib compression/decompression library (development)
Editor
  • vim: Vi IMproved – enhanced vi editor
Python
  • 全部
Web 分类
  • wget: Utility to retrieve files from the WWW via HTTP and FTP
  • curl: Multi-protocol file transfer command-line tool

 

 

 

 

                                       Please note sometimes you may get a download incomplete and the setup application will return to step 8. Simply select another server and continue the installation process. 

10.Once the installation is complete, click Finish and continue with the Setup section. 

Setup Windows Environment Variables:

2.安装Node.js

打开cygwin 终端

git clone https://github.com/joyent/node.git
cd node
./configure
make
sudo make install

到此安装成功。

3.测试node.js

创建hello.js

代码如下:

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:8124/');

保存到node 目录下 或其它目录

打开浏览器:  http://127.0.0.1:8124/

看到如下结果表明你已经成功安装node.js

转载于:https://www.cnblogs.com/justincai/archive/2012/08/16/2581568.html

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值