1.安裝node.js
https://npm.taobao.org/mirrors/node/v12.18.3/
https://npm.taobao.org/mirrors/node/v12.18.3/node-v12.18.3-x64.msi
2.設(shè)置node的全局和緩存路徑
在安裝目錄下新建兩個(gè)文件夾 node_cache踱卵、node_global
npm config set cache "D:\nodejs\node_cache"
npm config set profiles "D:\nodejs\node_global"
3.淘寶鏡像
npm install -g cnpm --registry=https://registry.npm.taobao.org
4.安裝yarn
npm install -g yarn
4.使用yarn安裝vue
yarn global add @vue/cli
5.查看yarn安裝路徑
yarn global dir
6.配置環(huán)境變量
7.如果是yarn 的prefix和cache目錄
yarn config set global-folder "你的磁盤(pán)路徑"
yarn config set cache-folder "你的磁盤(pán)路徑"
8.配置yarn阿里源
yarn config get registry
yarn config set registry https://registry.npm.taobao.org
yarn config set sass_binary_site"https://npm.taobao.org/mirrors/node-sass/"
yarn config set phantomjs_cdnurl"http://cnpmjs.org/downloads"
yarn config set electron_mirror"https://npm.taobao.org/mirrors/electron/"
yarn config set sqlite3_binary_host_mirror"https://foxgis.oss-cn-shanghai.aliyuncs.com/"
yarn config set profiler_binary_host_mirror"https://npm.taobao.org/mirrors/node-inspector/"
yarn config set chromedriver_cdnurl"https://cdn.npm.taobao.org/dist/chromedriver"