npm node 简述

快速入门

  1. 安装npm和管理npm版本

    npm安装

    SRE实战 互联网时代守护先锋,助力企业售后服务体系运筹帷幄!一键直达领取阿里云限量特价优惠。
  2. 更新npm

    1. npm -v
    2. npm install npm@latest -g
    3. npm install npm@next -g
  3. 安装一个包

    1. npm install
    2. 使用 package.json 安装包
      1. 创建一个package.json
      2. 执行命令 npm init
  4. 更新本地包

    npm update(在package.json文件所在目录)

  5. 卸载本地包

    npm uninstall

  6. 操作package.json

    新增 npm install --save
    更新 npm update --save
    卸载 npm uninstall --save

  7. 操作全局包

    新增 npm install -g
    更新 npm update -g
    卸载 npm uninstall -g
    10.最新包
    新增 npm install -g @latest
    11.特定版本包
    新增 npm install -g @1.1.1
    12.范围内版本包
    新增 npm install -g @">=0.1.0 <0.3.0"

命令行

  1. build 构建一个包

    npm build [ ]

  2. config 管理npm 配置文件
    1. npm config set [-g|--global]
    2. npm config get
    3. npm config delete
    4. npm config list [-l] [--json]
    5. npm config edit
    6. npm get
    7. npm set [-g|--global]
  3. start 执行脚本

    npm start [-- ]

  4. help 帮助

    npm help [<term..>]

npm用法

配置 npm

故障排除

扫码关注我们
微信号:SRE实战
拒绝背锅 运筹帷幄