node. JS Installation Steps

Source: Internet
Author: User

---restore content starts---

1.node. JS Official installation package and source code: http://nodejs.org/download/

As shown:

3. Click Next

4, tick "I accept the terms in the License agreement" agree to the license agreement, and click Next Next, the following interface appears:

5.node. JS default installation path is "C:\Program files\nodejs\", you can modify the path

6, here I directly default next next, ready to install:

7. After installation, open the Run Command window and enter CMD. Enter NODE-V to test whether the installation was successful,

8, NPM as a Nodejs module management

--We need to configure the path of the global module of NPM and the path of the cache, for example, I would like to place the above two folders in Nodejs's home directory, then set up "Node_global" and "Node_cache" two folder under Nodejs.

--Install the Express module.

NPM config set prefix "C:\Program files\nodejs\node_global"
NPM config set cache "C:\Program files\nodejs\node_cache"

In the command line, enter NPM install Express-g

After installing Express, creating a new project sometimes encounters an abnormal situation, prompting that "Express is not internal or external command " because the command tool is express4.x in the version, and a command tool needs to be installed.

Execute command "npm install-g express-generator"

It will be done after the test.

Before using the Express command, you also need to configure the environment variables.

Not using the module causes the input command to appear "XXX is not an internal or external command, it is not a running program or batch file" error.

At the end of PATH add ";%node_path%";

If all the above steps are OK, we can open the cmd command line again, enter node and type "require (' Express ')"

To test whether the module global path for node is configured correctly. The correct CMD will list information about the Express.

---restore content ends---

node. JS Installation Steps

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.