Home > Web Front-end > HTML Tutorial > A collection of npm common commands for nodejs

A collection of npm common commands for nodejs

php中世界最好的语言
Release: 2018-03-14 09:38:32
Original
2018 people have browsed it

This time I will bring you a collection of common npm commands for nodejs. What are the precautions for using the npm common command collection for nodejs? Here are practical cases, let’s take a look.

NPM provides many commands, such as install and publish. Use npm help to view all commands.

Use npm help to view detailed help for a certain command, such as npm help install.

Use npm install . -g in the directory where package.json is located to install the current command line program locally first, which can be used for local testing before release.

Use npm update to update the corresponding module in the node_modules subdirectory in the current directory to the latest version.

Use npm cache clear to clear the NPM local cache, which is used to deal with people who use the same version number to release new versions of code.

Use npm unpublish @ to unpublish a version of code you have published.

Use npm update -g to update the corresponding command line program installed globally to the latest version.

Update npm to the latest version, execute the command: npm install npm@latest -g
latest can be set to any version number

I believe you have mastered the method after reading the case in this article, more Please pay attention to other related articles on the php Chinese website!

Recommended reading:

How to use select to get the selected value

Input type=number decimal problem

Require.js detailed explanation

The above is the detailed content of A collection of npm common commands for nodejs. For more information, please follow other related articles on the PHP Chinese website!

Related labels:
source:php.cn
Statement of this Website
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
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template