使用Yarn
- 定位:包管理工具,替代npm
- 安装速度快,版本锁定,缓存机制
- 安装
npm install yarn -g - 语法:
| Yarn | Npm |
|---|---|
| yarn init | npm init |
| yarn | npm install |
| yarn global add xxx@x.x.x | npm install xxx@x.x.x -g |
| yarn add xxx@x.x.x | npm install xxx@x.x.x --save |
| yarn add xxx@x.x.x --dev | npm install xxx@x.x.x --save-dev |
| yarn remove xxx | npm uninstall xxx --save(-dev) |
| yarn run xxx | npm run xxx |