NodeJS, NPM installation configuration steps (Windows version)

Source: Internet
Author: User

1.NodeJS Installation

1.windows under the Nodejs installation is more convenient, only need to login official website (http://nodejs.org/), directly click the Download button.

2. The installation process is basically direct "NEXT" (the installation MSI file of Windows will add the system variable of path directly in the process, the variable value is your installation path, for example "C:\Program Files\nodejs").

3. After the installation is complete, you can use CMD to test if the installation is successful.

      $ node-v

      

Installation of 2.NPM

1. Since NPM has been integrated with the new version of Nodejs, NPM has been installed and tested for successful installation.

       $ npm-v

       

2. The conventional Nodejs is now complete, and also in the cmd command line Input "node" into node development mode, enter:

      > console.log (' Hello World ');

3. Configure the Node module global path

1. Configure the storage path of the NPM global module and the cache path first.

Create a new "Node_global" and "Node_cache" two folders under Nodejs's home directory.

      

2. Start cmd

      $ npm config set cache "C:\Program files\nodejs\node_cache"

      $ npm config set prefix "C:\Program files\nodejs\node_global"

  3. Choose Express, the more commonly used module test.

      $ npm Install express-g ("-g" This parameter means to be loaded into the global directory).

      

3. Open the System dialog box, "My Computer" right "properties"-"Advanced system Settings".

      

3. Enter the Environment Variables dialog box, create a new "Node_path" Under System variables and enter "C:\Program files\nodejs\node_global\node_modules" (PS: This step is quite critical). The user variable "PATH" is modified to "C:\Program files\nodejs\node_global\ "If you do not use the module, it causes the input command to appear" XXX is not an internal or external command, or a program or batch file that can be run "error.

      

4. Test node's module global path is configured correctly.

      $ node

> Require (' Express ')

      

      Ok!    

NodeJS, NPM installation configuration steps (Windows version)

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.