Nodejs Chinese tutorial-windows the installation and configuration of NODEJS development environment __JS

Source: Internet
Author: User
Tags openssl install node nameserver version control system
Is it node.js? Also server-side JavaScript? For this concept I do not explain this article, you can go to search to understand, server-side JS is not a new technology, but the recent node.js of the hot let him broke out, I will explain in the future article what is node.js. Here is just pure build, even the environment is not, also play what server-side JS, everything has become a cloud, let us first set up an environment, input a "Hello World" page.

Yes, Win7 under the construction, you only need to follow me step-by-step, OK, do not need to know too much detail, it is not our concern now, we are now the primary goal is to build the environment, or there is no next step.

Step 1. Download
Node.js under Windows is to be installed under Cygwin, to Cygwin web site to download Cygwin Setup program.

Cygwin website: http://cygwin.com/

Direct Download Address: Http://cygwin.com/setup.exe

Step 2. Installation
Install the Cygwin program you have down, basically just the next step.

Select from Choose A Download Source interface-Install from internet

In the Select Your Internet Connection Interface Selection-"Direct Connect"

In Choose A Download Site Interface Selection-"This choice, is to choose the image of the download, recommended use." JP End of the Japanese website, faster

Note: If you are installing for the first time, you may be prompted with a warning, regardless of his, click OK.

Step 3. Select Installation Components
Note: Because of the larger number of components, it is recommended that you use search methods to find. Click on the name to select, after selection, there will be a small box, which has X (fork) to indicate selected.

Devel classification
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 classification
Vim:vi improved–enhanced Vi Editor

Python classification
All
Note: All you have to do is click on the icon on the right side of Python to switch to Install.

Web classification
Wget:utility to retrieve files from the WWW via HTTP and FTP
Curl:multi-protocol File Transfer command-line tool

The next step will prompt you to have a number of dependent components to install, basically directly to the next step.
Note: Because components are downloaded online, it may be a bit long to wait.

Step 4. Run Ash.exe

After installation, the icon is generated on the desktop (if you choose to generate an icon on the desktop), note that it is not running this icon.

Open the folder, enter the C:\cygwin\bin\ directory, this is the default installation directory, if you have modified the installation directory, you go to the Cygwin installation directory in the bin directory.

Run Ash.exe

Executes the./rebaseall-v command in a pop-up command window

Wait for the command to finish execution exit exit Ash

Step 5. Download and install Node.js

Run the Cygwin program on the desktop.

Enter the wget http://nodejs.org/dist/node-v0.4.7.tar.gz carriage return in the command window.

Note: I am writing this article is the latest version of Node.js is node-v0.4.7, http://nodejs.org/dist/node-v0.4.7.tar.gz Node.js is the download address, you read this article you can go to Node.js's website to get the latest download path to replace it

Node.js Website: http://nodejs.org/

Enter the Tar XF node-v0.4.7.tar.gz carriage return in the command window, node-v0.4.7.tar.gz the version you downloaded for yourself.

Enter the CD node-v0.4.7 carriage return in the command window.

Enter the./configure carriage return in the command window.

Enter make carriage return in the command window.

Enter make install carriage return in the command window.

OK, you've already installed the node.js.

Enter Node–version carriage return in the Command window and look at your node.js version.

Step 6. Setting up DNS
Open the folder and go to the C:\cygwin\etc\ folder.

Manually create the resolv.conf file.

Open the resolv.conf file you just created with Notepad and add the following

NameServer 8.8.8.8
NameServer 8.8.4.4
Save and close.

Step end. Test whether Node.js can run

So you've built it, but you don't know if it's going to work correctly, so let's write a sample file to test it.

Establish example.js in the C:\cygwin\ directory

Input
var http = require (' http ');

Http.createserver (function (request, response) {
Response.writehead ({' Content-type ': ' text/html '});
Response.End (' <b>hello world</b> ');
}). Listen (8888);

Console.log (' Server running at http://127.0.0.1:8888/');

Save (Note: Save as UTF-8 format, or you will report a syntax error).

Run Cygwin, enter node/example.js carriage return in the command window

Have you seen the server running at http://127.0.0.1:8888/

Do not close Cygwin, open the browser, visit http://127.0.0.1:8888/to see if there is a Hello World page.

Reference Address: http://baiyejianxin.iteye.com/blog/1084550

Original address: Http://www.congci.com/item/win7-nodejs

Related Article

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.