yarn有以下3个优点 :
安装速度快 (服务器速度快 , 并且是并行下载)
版本锁定
缓存机制
Yarn语法
npm init ---- yarn init
npm install ---- yarn
npm install xxx@1.1.1 -g ---- yarn global add xxx@1.1.1
npm install xxx@1.1.1 --save ---- yarn add xxx@1.1.1
npm install xxx@1.1.1 --save-dev ---- yarn add xxx@1.1.1 --dev
npm uninstall xxx --save(-dev) ----yarn remove xxx
npm run xxx ---- yarn run xxxx
安装方式: npm install yarn -g
yarn install
运行:
yarn serve
Compiles and minifies for production
yarn build
Lints and fixes files
yarn lint