安装n模块
sudo npm cache clean -f
sudo npm install -g n
sudo n stable
升级npm的版本
sudo npm install npm@latest -g
安装vue2
sudo npm install -g vue-cli
安装vue3
如果要安装vue3,需要首先将vue2卸载,然后安装vue3
sudo npm uninstall -g vue-cli
sudo npm install -g @vue/cli
使用vue3创建vue项目
vue create hello-world
运行vue项目
$ cd hello-world
$ npm run serve