Yarn

yarn是与npm类似的一个JavaScript包管理工具。

安装

1
$ brew install yarn

若提示错误 Error: An exception occurred within a child process: CompilerSelectionError: yarn cannot be built with any available compilers.需要先装gcc

1
$ brew install gcc

安装gcc过程中若提示错误Error: gcc: the bottle needs the Xcode CLT to be installed.可执行下面的命令

1
$ xcode-select --install

使用

1
2
3
4
5
6
$ yarn global add @vue/cli
$ yarn global upgrade --latest @vue/cli
$ yarn run build
$ yarn run serve
$ yarn add eslint-plugin-html --dev
$ yarn remove @vue/cli-plugin-pwa --dev

Reference