Yarn
Node.js Yarn 管理套件
yarn 兼容 npm 的 package.json
套件管理,提供更快、安全、可靠的套件管理
安裝 yarn
$ npm install --global yarn
yarn & npm 指令比較
npm | yarn | 說明 |
---|---|---|
npm install | yarn install | 安裝套件 |
npm install [package] | 不支援 | 直接安裝指定套件 |
npm install –save [package] | yarn add [paakage] | |
npm install –save-dev [package] | yarn add [paakage] –dev | |
npm install –global [package] | yarn global add [package] | 套件安裝在全域 |
npm uninstall [package] | 不支援 | 直接移除指定套件 |
npm uninstall –save [package] | yarn remove [package] | |
npm uninstall –save-dev [package] | yarn remove [package] | |
rm -rf node_modules && npm install | yarn upgrade | 更新套件 |
npm cache clean | yarn cache clean [package] | 清除快取 |
npm update –global | yarn global upgrade | 更新全域套件 |