Appium _ install node. js and NPM module management on Windows

Source: Internet
Author: User
Tags appium

In May September, I wrote an article about how to manually manage node. js modules on the Windows platform [install the node. js module on Windows]. At that time, on the one hand, I had limited understanding of node. JS, and it was really troublesome to deploy node. js on the Windows platform, so I chose to manually manage the node. js module.

Now the situation has changed significantly. On the one hand, node. js has completed the transformation of the port-based network model on the Windows platform, and on the other hand, NPM can work well on the Windows platform. Therefore, it is easier to deploy node. js on the Windows platform. The following describes my operation steps.

1. Download the official node. js program for Windows:
Http://nodejs.org/#download
Starting from 0.6.1, node. js provides two installation methods on Windows. One is the. MSI installation file and the other is the. exe executable file.
I selected the. exe file. In addition to copying node.exe to the C: \ Program file (x86) \ directory and modifying the system path, the. msiinstallation file has no other functions.
My version is 0.6.2: http://nodejs.org/dist/v0.6.2/node.exe

2. Create the D: \ nodejsdirectory and save node.exe in this directory. Add "D: \ nodejs" to the path of the system environment variable to facilitate node application execution at any location.

3. Download NPM source code:
Https://github.com/isaacs/npm/tags
Note that at the time of writing this article, the latest NPM version is 1.0.106, but this latest version and 1.0.105 have problems on the Windows platform. So I chose to install version 1.0.104:
Https://github.com/isaacs/npm/zipball/v1.0.104

4. decompress the NPM source code to the D: \ npmjs directory.
In the Command Prompt window, perform the following operations to complete NPM installation:

D:\>cd npmjs
D:\npmjs>node cli.js install -gf

In addition:

Node cli. js install NPM-GF // you can install the latest NPM version.
Node cli. js install npm@1.0.105-GF // you can install the specified version of NPM

The above two methods are downloaded and installed from the code library through the network, but the code library generally only keeps the last two versions.

5. After NPM is installed, add "D: \ nodejs \ node_modules" to the system environment variable node_path.

6. Install Express:

NPM install express-G // install the latest version of Express
NPM install express@2.5.0 // install a specified version of Express

NPM remove express-G // Delete Express

For more NPM usage, refer to NPM Official Website: http://npmjs.org

Now the deployment is complete.

D: \> node-V
V0.6.2

D: \> NPM-V
1.0.104

D: \> express-V
2.5.1

D: \> express Hello // create an exrpess Project
D: \> Cd hello
D: \ Hello> node app. js // start

Open http: // localhost: 3000 in the browser and view the result.

Supplement: The NPM source code package does not contain dependency modules. For easy installation, download is provided here:

Http://files.cnblogs.com/seanlv/node_modules.zip

After downloading, overwrite the node_modules folder in the NPM directory.

Reprinted from: http://www.cnblogs.com/seanlv/archive/2011/11/22/2258716.html

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.