(1)首先试试
npm config set registry https://registry.npm.taobao.org --global
npm config set disturl https://npm.taobao.org/dist --global
或者
yarn config set registry https://registry.npm.taobao.org --global
yarn config set disturl https://npm.taobao.org/dist --global
(2)若不行再试试
使用yarn时,报如上错误,可能原因:
1.没有安装python,先执行:
npm install -g node-gyp (编译环境)
npm install --global --production windows-build-tools
2.如果依然报错,如下执行:
npm install -g mirror-config-china --registry=http://registry.npm.taobao.org
npm install node-sass
yarn install