Install the node. js development environment under windows8.1 + iis8.5, and windows8.1node. js

Source: Internet
Author: User

Install the node. js development environment under windows8.1 + iis8.5, and windows8.1node. js

Nodejs wanted to play games a long time ago, but it never took enough time. It took four hours last night to successfully set up the node on iis.

PS: My system is Windows 8.1 x64, so it comes with iis8.5 and the downloaded file is x64.

No.1: download an object

Nodejs http://www.nodejs.org/download/.

Isnode https://github.com/tjanczuk/iisnode/wiki/iisnode-releases

Iis url Rewrite http://www.iis.net/downloads/microsoft/url-rewrite

No. 2: Installation

OK. After the file is downloaded, the next step is to install the file. However, during the installation process of win8.1, the msi installation package encountered an error code 2503. I did not know the cause after searching for a long time, but there is a solution online.

Solution: http://jingyan.baidu.com/article/a501d80cec07daec630f5e18.html

Simply put, run CMD as an administrator and go to your *. msi folder. Enter the program name (*. msi) in CMD to install it.

You need to select the folder for nodejs during the installation process, and directly click next for others. Of course, you must agree to the Protocol.

No. 3: Configuration

After the three files are installed, run CMD as the administrator. If you enter node-v, the nodejs version is displayed. If you enter nmp-v, the nmp version is displayed, (I don't know what nmp is doing. I got started on the first day ).

The version number shows that you are half successful, now start to configure the environment. http://www.bkjia.com/article/50260.htm here is my reference, beginner

Go to the nodejs folder and enter the following command (one line at a time, I only use these two Commands .)

Copy codeThe Code is as follows: npm install express-g npm install jade-g
Now the nodejs environment is ready, and the rest is to use iis.

No. 4: tamping IIS

I don't need to open iis so I can enable it myself. I don't know Baidu. Here are some tutorial addresses:

Http://www.bkjia.com/ OS /Windows8/85544.html

I select all options for IIS. Of course, many of them are useless.

Next, let's take a look at the image operation process:

OK, the iis ing has been completed, and the next step is to create a small test page.

Find a folder as the root directory of the Website: Create a serve folder and put a js file name in it. The arbitrary file content is:

Copy codeThe Code is as follows: var http = require ('HTTP '); http. createServer (function (req, res ){
Res. writeHead (200 ,{
'Content-type': 'text/html'
});
Res. end ('hello, world! ');
}). Listen (process. env. PORT );


Then you can directly access the file in the test website you created using a browser. My files are http: // 127.0.0.1/serve/s. js.

We can see that a classic hello world is output.

I also started to get in touch with node. js.

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.