node. js installation and module management for node. js

Source: Internet
Author: User
Tags install node


node. js installation and module management for node. js
node. JS development environment Building and support for ES6
node. JS Building Vue.js Project
Vue.js single-File component development
Use of the Vue.js-based UI component (Element)

One: node. JS is spelled correctly

A long time ago, I was impressed by the blog that wrote a jquery plugin definition. It was originally intended to discuss the standardized definition of jquery plug-ins, which led to the question of jquery writing.

The Jquery notation is ever-changing: jquery,jquery,jquery,jquery. Many people did not pay attention to this writing problem, the official website gives the correct wording is jQuery.

Today, when writing node. JS technology sharing, it was found that the name is so complex that it can be written more than jquery, node. js, Node.js,node.js,nodejs,nodejs,nodejs, etc. The correct wording given by the website is node. js.

II: node. JS Installation

1,node.js Wizard Installation:

There are many ways to install node. js on the web, many for older versions, or for installations on other operating platforms. The pre-node. JS integration is not high, node. JS is installed, and NPM tools are installed.

Now node. JS installation is a wizard, I am based on the node. JS v8.9.4 version on the Win7 installation, want to write a installation instructions, but the next step in the installation, the next step is done, so I want to write the installation instructions can not start.

Think about it and make a note of the most complicated interface in the installation.

2, start of the node. js Command window:

The installation was successful and you can open the node. JS command-line window from the Start menu:

You can also execute the node. js command through the Windows CMD window by typing the cmd command from Win + R.

3. View the version number of node. js from the command line, NPM version number

When you start the command-line window, you can try entering the following command line to view the version number of the installer:

View the node. JS version number, method 1:node-v/method 2:node--version

View NPM version number, method 1:npm-v/method 2:NPM--version

4, Experience node. JS Code Authoring

Console.log (' Hello node. js ');
Console.log (function() {return "result";} ());
(function() {console.log ("Hello node. js");  return "Result";} ())

III: Installation of the node. JS module, viewing, uninstalling

The installation of node. JS is divided into global installations and local installations in two ways:

1, Global installation

View the global installation path

View method One: View npm root-g/NPM root--global from the command line

The generic path points to one of the following directories:

C:\Program Files\nodejs\node_modules

View Method Two:


Global installation Commands: NPM install ******-G or npm install ******--global

Where-G--global equivalent, is the parameter of the global installation

Is the module that represents the installation to be installed

After a successful global installation, commands can be executed from the command line


NPM Install Mysql-g

NPM View Mysql-g

NPM Uninstall Mysql-g

2, Local Installation

Jump the command line to the installed directory,

Then install it via the command line NPM install ****** or NPM install ******--save-dev

Represents a module that needs to be installed

--save-dev is the Devdependencies property that writes the installation package information to the Package.json file.

After local installation, modules in the Node_modules directory in the project can be introduced via require (). As the following example, the local installation is require (' MySQL ') directly in Gulpfile.js.


This blog describes the installation of node. JS and the management of the node. JS module. Those who are interested in node. JS can take note of subsequent blogs.

node. js installation and module management for node. js

Related Article

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: 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.