因爲 vue init 使用的是 npm源,是國外的
1.查看npm源
//查看源,可以看到設置過的所有的源
npm config get registry
2.設置npm源
//設置淘寶源
npm config set registry https://registry.npm.taobao.org
// 安裝cnpm命令,不會改變npm的源
npm install -g cnpm --registry=https://registry.npm.taobao.org
3 npm 安裝yarn
npm install -g yarn
配置下yarn 源
yarn config set registry https://registry.npm.taobao.org -g
yarn config set sass_binary_site http://cdn.npm.taobao.org/dist/node-sass -g