安装

brew install nodejs
% brew install nodejs
==> Downloading https://mirrors.cloud.tencent.com/homebrew-bottles/bottles/libuv
######################################################################## 100.0%
==> Downloading https://mirrors.cloud.tencent.com/homebrew-bottles/bottles/node-
######################################################################## 100.0%
==> Installing dependencies for node: libuv
==> Installing node dependency: libuv
==> Pouring libuv-1.41.0.arm64_big_sur.bottle.tar.gz
????  /opt/homebrew/Cellar/libuv/1.41.0: 49 files, 3.2MB
==> Installing node
==> Pouring node-16.3.0.arm64_big_sur.bottle.tar.gz
????  /opt/homebrew/Cellar/node/16.3.0: 2,777 files, 48MB

查看版本

% node -v
v16.3.0
% npm -v
7.15.1

安装cnpm

% npm install -g cnpm --registry=https://registry.npm.taobao.org 

安装vue

% npm install vue

安装vue-cli

% npm install -g @vue/cli