Nodejs Module Installation: __js

Source: Internet
Author: User

If you want to install the Nodejs not installed can go to download: http://nodejs.org/ 1, open cmd execute the following command:

①, we will first configure NPM's global module storage path and cache path, for example, I would like to put the above two folders in the Nodejs's home directory, under the Nodejs set up "Node_global" and "Node_cache" two folder.

②, start cmd, input:
npm config set prefix "C:\Program files\nodejs\node_global
npm config set cache" C:\Program Files\nodejs\node_cache "

③, now we have to install a module to try, choose Express this more commonly used modules." Also in the cmd command line, enter "NPM Install Express-g" ("G" This parameter means to be loaded into the global directory, which is said to set the "C:\Program Files\nodejs\node_global" inside. )。 After the installation of CMD inside the completion of the scroll, will prompt "Express" installed in the version and its directory structure is how.
2, configure the environment variable to path:
Enter the environment Variable dialog box, create a new "Node_path" under the system variable, and enter "C:\Program files\nodejs\node_global\node_modules". (PS: This step is quite critical.)
because the default address of module is changed, the user variables above are changed (user variable "PATH" is modified to "C:\Program files\nodejs\node_global\"), If you do not use module, the input command appears with the error "XXX is not an internal or external command, nor a running program or batch file."

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.