Home > Backend Development > PHP Tutorial > Summary of npm common commands

Summary of npm common commands

不言
Release: 2023-04-04 22:32:01
forward
2206 people have browsed it

This article brings you a summary of commonly used npm instructions. It has certain reference value. Friends in need can refer to it. I hope it will be helpful to you.

Something about npm
.Command line window

 - 常用的指令:
    dir 列出当前目录下的所有文件
    cd 目录名 进入到指定的目录
    md 目录名 创建一个文件夹
    rd 目录名 删除一个文件夹
 - 目录
    . 表示当前目录
    .. 表示上一级目录
Copy after login
  • npm command

    • npm -v Function: View the version of npm

    • npm version Function: View the version of all modules

    • npm search/s Package name Function: Search Package

    • npm install / i package name Function: install package

    • npm remove / r package name Function: delete package

    • npm install package name --save Function: Install the package and add it to dependencies*

    • npm install Function: Download the current project Dependent packages

    • npm install package name -g Function: Global installation package (global installation packages are generally some tools)

       //
       
        npm init                     初始化项目(创建package.json)
        npm i/install 包名           安装指定的包
        npm i/install 包名 --save    安装指定的包并添加依赖
        npm i/install 包名 -g        全局安装(一般都是一些工具)
Copy after login

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

Related labels:
source:segmentfault.com
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