NPM installation and use of the Express framework

Source: Internet
Author: User

I. Installing node. js

Download node. js and place it in the right place

Second, modify the environment variables

Add the node execution path to the system's environment variable path, adding "C:\Program files\node\" at the end of the value of the path variable;


Third, verify node installation

Open the command line, enter node, the description succeeds

Iv. Download the decompression npm1. Download NPM

Select Zip Package, Address: https://github.com/npm/npm/tags

2. NPM's Compression pack

3. Unzip the NPM package

V. Installation of NPM
Enter the root directory of the NPM package
and execute the Command "node Cli.js install NPM-GF"

Many more files after execution, including the executable NPM

VI. Test NPM Installation

Vii. installation of Express

Execute command "NPM install Express-g"

The directory after execution

More express catalogs are available in the Node_modules directory.

Attention:

Unable to execute express command after execution because there is no express command in the node root directory

Installation of Executable Express

Reference https://www.npmjs.com/package/express

Execute command "NPM install-g [email protected]"

The node root directory after execution

Nine, verify Express installation

Enter "Express-v" (note that the upper case is V)


Ten, Test Express1. New Express Project

Create a new Express-test folder on the desktop

Use the CD command to enter, execute the command "express./"

2. After the execution of the directory

3. Add dependencies for the project

Specific dependency configuration in Package.json

Execute command "NPM install"

4. Start the project

Execute command "NPM start"

5. Test whether the project is started

Enter the address "localhost:3000" in the viewer and see as shown in the instructions to start successfully

6. Changes to the console

NPM installation and use of the Express framework

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.