npm node 简述
快速入门
安装npm和管理npm版本
更新npm
- npm -v
- npm install npm@latest -g
- npm install npm@next -g
安装一个包
- npm install
- 使用 package.json 安装包
- 创建一个package.json
- 执行命令 npm init
更新本地包
npm update(在package.json文件所在目录)
卸载本地包
npm uninstall
操作package.json
新增 npm install --save
更新 npm update --save
卸载 npm uninstall --save操作全局包
新增 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"
命令行
build 构建一个包
npm build []
- config 管理npm 配置文件
- npm config set [-g|--global]
- npm config get
- npm config delete
- npm config list [-l] [--json]
- npm config edit
- npm get
- npm set [-g|--global]
start 执行脚本
npm start [-- ]
help 帮助
npm help [<term..>]