Install and configure the node. js environment in Windows

Source: Internet
Author: User

Install and configure the node. js environment in Windows

Nodejs installation and environment configuration in win system:

Step 1:Download the Installation File

Download nodejs, Official Website: http://nodejs.org/download/. here I download node-v0.10.28-x86.msi, for example:

Step 2:Install nodejs

After the download is complete, double-click "node-v0.10.28-x86.msi", start to install nodejs, custom installed under D: \ dev \ nodejs.

Enter: node-v in the cmd console, and the console will print v0.10.28. If a version prompt is displayed, the installation is successful.
This wizard will install the node.exe file to the Directory D: \ dev \ nodejs \ and add the directory to the PATH environment variable.

Step 3:Npm Installation

The new nodejs version has integrated npm, so npm has been installed together. You can also use the cmd command line to enter "npm-v" to test whether the installation is successful. If a version prompt is displayed, the installation is successful.

Step 4:Installation environment

npm install express -g npm install jade -gnpm install mysql -g

By default, the above components are installed in the D: \ dev \ nodejs \ node_modules folder, which is also the automatic search path for node. js-related components.

Step 5:Install CoffeeScript

npm install coffee-script -g

Confirm the installation command: coffee-v. if the version number is displayed, the installation is successful.

Step 6:CoffeeScript test instance

Create a cs. js file and enter:

for i in [0...5]console.log "hello #{i}"

Run "coffee cs. js" in this directory to output:

D: \> coffee cs. js
Hello 0
Hello 1
Hello 2
Hello 3
Hello 4

The above environment is basically configured.

Note:

All commands are installed globally by-g. In this way, the installation package is under the current user and accessible from all other locations on the disk for comparison. Otherwise, it is installed in the current directory and can only be used in the current directory.

Installing express

After installing the nodejs installation package and installing express through npm, run the express prompt "express" is not an internal or external command, because it is a version problem. The current version is 4.0.0. Change it to 3.5.0 to run it.
$ Npm install-g express@3.5.0

Global installation is in the C: \ Users \ xdskg \ AppData \ Roaming \ npm directory.

The above is all the content of this article. I hope it will be helpful for your learning and support for helping customers.

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.