Home >Web Front-end >Front-end Q&A >How to install nodejs module
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.
The operating environment of this tutorial: windows7 system, nodejs version 14.15.4, DELL G3 computer.
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 moduleEnternpm uninstall module name# in the terminal
##For example, to uninstall the express module, you can execute
. 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 TutorialThe above is the detailed content of How to install nodejs module. For more information, please follow other related articles on the PHP Chinese website!