Yarn
Node.js Yarn 管理套件
Categories:
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 | 更新全域套件 |