_javascript Techniques for simple NODEJS installation and environment configuration under Windows System

Source: Internet
Author: User

I believe that for many students concerned about the development of JavaScript, Nodejs has not been a strange word eye. The relevant information about Nodejs has been on the Internet. Because of its high concurrency characteristics, it has created its special application status.

At present, the highest concern in China, the maintenance of the best one about Nodejs website should be http://www.cnodejs.org/

We don't want to talk too much about Nodejs. Just say, Windows system simple NODEJS environment configuration.

First step: Download the installation files

Download Address: official website http://www.nodejs.org/download/

It's used here.

Step Two: Install Nodejs

After the download is complete , double-click Node-v0.8.16-x86.msi to begin installing Nodejs, which is installed under C:\Program Files\nodejs

Step three: Install the relevant environment

Open the C:\Program Files\nodejs directory you'll find that it's got npm in it, and you can use NPM to install the environment directly

Enter node.js command prompt commands window

Enter Nodejs installation directory C:\Program Files\nodejs

Type command: CD C:\Program Files\nodejs can

Start the installation of the relevant environment now

Type command: NPM Express carriage return waiting for express ...

Type command: NPM Jade Carriage return waits to install jade ...

Type command: NPM mysql carriage return waits for MySQL to be installed ...

........ What components to install, depending on the environment to build requirements

By default, these components are installed under the C:\Program Files\nodejs\node_modules folder, which is also the automatic lookup path for NODEJS related components

Step Fourth: Create a project

Now there's the Express

Type: Express MyApp (MyApp is a random project name)

You'll find one more C:\Program Files\nodejs\myapp directory

By default: automatically creates

These documents, do not explain, I believe that have developed experience in the students can be a glance.

Copy Node_modules to MyApp below

The environment is built to this completion, the following do a demo test!

Create a new helloworld.js under MyApp

Copy Code code as follows:

var http = require ("http");
Http.createserver (function (request, response) {
Response.writehead ({"Content-type": "Text/plain"});
Response.Write ("Hello World");
Response.End ();
}). Listen (8888);
Console.log ("Nodejs Start listen 8888 port!");

Enter the Node.js command prompt Commands window and enter the C:\Program Files\nodejs\myapp directory

Type node Helloworld.js

Open Address http://127.0.0.1:8888/

Discovery Output: Hello World

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.