Install Node + NPM in Windows

Source: Internet
Author: User
Tags install node

Install Node + NPM in Windows

Author: zhanhailiang Date:

1. download and install the latest version nodejs: node-v0.10.32-x64.msi. Note: During installation, add node.exe to the Path. The test is as follows:

D:\Users\wade.zhan>node --versionv0.10.32

2. Download and install git: git. The test is as follows:

D:\Users\wade.zhan>git --versiongit version 1.9.2.msysgit.0

3. Install NPM:

D:\Users\wade.zhan>git config --system http.sslcainfo /bin/curl-ca-bundle.crtD:\Users\wade.zhan>git clone --recursive git://github.com/isaacs/npm.gitD:\Users\wade.zhan>cd npmD:\Users\wade.zhan>node cli.js install npm -gf

Now, Node and NPM have been installed.


How to Develop nodejs on windows?

Node. js is implemented in windows. Please download it from node.org on its official website. You can use both exe and msi.
The installation is the same as the normal software installation after the download. Usage:
Open in the Start menu and select Node. js command prompt. It automatically adds environment variables to you and can directly use node and npm commands.
Node command: node (Space) js program. Use an absolute address. You can use node-h to view other parameters.
Npm command: npm is the command for node to install a third-party module. Use the simple npm install Module name. You can use npm-h to view other parameters.
All npm modules must be registered on npm.org.
In addition, cnodejs.org is a good Chinese community. Chinese documents are also provided.

Another point is that the platform selection is not as good as linux. node's core event-driven mechanism is simulated in linux using the libev + libeio library, windows itself provides system calls, and the tested performance data is windows's biggest advantage. Of course, this does not affect your use of node. js in windows and linux. It is completely cross-platform!

This is a quick start guide for beginners:
1. Create a new file named first. js.
2. Write in the file:
Var http = require ('http'); http. createServer (function (request, response) {response. writeHead (200, {'content-type': 'text/plain '}); response. end ('Hello World \ n ');}). listen (8124); console. log ('server running at localhost'); 3. After the command is input and run wildly, the "Server running at localhost" will be displayed in the "small black box". at this time, enter localhost: 8124 to display Hello World. In this way, a simple web server is built.


Build a Phonegap Environment

Follow these steps to build an Android development project using PhoneGap:
Install the android development environment and configure environment variables.
Install the Node. js environment and configure environment variables.
Use npm to install the global environment of PhoneGap.
Use the PhoneGap command to create a PhoneGap project.
Compile PhoneGap into an android project.
Import the above project to ADT for subsequent development.

The procedure is as follows:

1. install and configure the android development environment:
Download the latest ADT to the local machine and decompress it to the corresponding directory.
Next, you need to configure the environment variables and configure the following two paths to the system PATH:
A, {ADT_HOME} \ sdk \ platform-toolsB, {ADT_HOME} \ sdk \ tools
This completes the configuration of the android development environment.

Ii. install and configure Node. js:
Download and install Node. js for windows.

3. Install the PhoneGap environment:
Run the following command:
Cmd code
Npm install-g phonegap
This command installs and configures the global environment of phonegap from the network. Ensure that the network is smooth.

4. Create a phonegap project:
Run the following command:
Phonegap create my-app
Here, my-app is the name of the project you want to use. This project will be created to the current directory, so before that, please move the current directory to the address you want.

5. compile the project into an android project:
In the preceding command line window, run the following command:
Cd my-app
Phonegap build android
These are two commands. The first one is to enter the current directory to the directory you created. The second command compiles the current project into an android Project (that is, a project that can be used in eclipse of ADT ).

6. Import the project to eclipse of ADT:
Start eclipse in ADT, select File-New-Project, select Android-> Android Project from Existing Code in the open "New Project" wizard, and select Next
In the next navigation page, select the my-app/platforms/android folder created in Root Directory. Select both Projects under projects, but do not select the Copy Projects into workspace option.
Select Finish to complete the import.

So far, an android project environment supporting phonegap has been built. You can start this project according to your android development habits.

========================================================== ========================================
For iOS development projects built using PhoneGap, see the reference link.

Reference: www.cnblogs.com/mohe/p/3442348.html
... Remaining full text>

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.