安裝nvm 和 yarn
安裝nvm
curl -o- https://raw.githubusercontent.com/nvm-sh/nvm/v0.37.2/install.sh | bash
curl -o- https://raw.githubusercontent.com/nvm-sh/nvm/v0.38.0/install.sh | bash
修改hosts 才能安裝成功
sudo vim /etc/hosts
199.232.96.133 raw.githubusercontent.com
重啟網絡卡
systemctl restart NetworkManager.service
安裝成功後
安裝node 16.13.0
nvm install v16.13.0
使用 16.13.0
nvm use v16.13.0
檢視安裝環境
nvm current
nvm list
更換預設環境
nvm alias default v16.13.0
安裝yarn
curl -sS https://dl.yarnpkg.com/debian/pubkey.gpg | sudo apt-key add -
echo "deb https://dl.yarnpkg.com/debian/ stable main" | sudo tee /etc/apt/sources.list.d/yarn.list
sudo apt update && sudo apt install yarn
sudo apt-get remove yarn
sudo apt-get autoremove
npm install -g cnpm --registry=https://registry.npm.taobao.org //安裝cnpm
安裝vue-cli
要 初始化
yarn init
新增淘寶源
npm config set registry http://registry.npm.taobao.org/
npm install -g @vue/cli
yarn add global @vue-cli
速度不行可以考慮換源 npm
安裝完畢 後 輸入
常規安裝
vue create vueproject