Home  >  Article  >  Web Front-end  >  How to install nodejs module

How to install nodejs module

青灯夜游
青灯夜游Original
2021-09-15 17:29:233142browse

Module installation method: 1. Use cd in the terminal to enter the node installation directory, execute the "npm -v" command to check whether npm has been installed. If the npm version is too low, it can be updated; 2. Execute "npm install module Name" command to install the module; 3. Execute the "npm ls" command to check whether the module is installed successfully.

How to install nodejs module

The operating environment of this tutorial: windows7 system, nodejs version 14.15.4, DELL G3 computer.

nodejs uses npm command to install modules

1. First, enter the directory where node.exe is located in the terminal (enter cd directory) and check whether npm has been installed. Enter npm -v

If the following interface appears, it proves that the installation has been successful: (Since the new version of nodejs has integrated npm, npm was also installed before)

2. It is possible that the installed npm version is relatively low. At this time, you can update it through npm install npm-g in the terminal.

After the update is successful, the following interface will appear:

3. Enter npm install module name in the terminal to install the specified module

Example: Enter npm install express (express is commonly used Node.js web framework module)

After successful installation, the following interface will appear:

4. To check whether the installation is successful, enter npm ls## in the terminal.

#The following interface appears when successful:

4. Uninstall the module

Enter

npm uninstall module name# in the terminal ##For example, to uninstall the express module, you can execute

npm uninstall express

. If the uninstallation is successful, the following interface will appear:

Check whether express still exists. Enter

npm ls

in the terminal, and the following interface will appear:

[Recommended learning: "

nodejs Tutorial

"]

The above is the detailed content of How to install nodejs module. For more information, please follow other related articles on the PHP Chinese website!

Statement:
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Previous article:Does vuejs support ie678?Next article:Does vuejs support ie678?