开始
前提,正确安装nodejs,这里给出一份npm配置文件,.npmrc
注意: 不要使用cnpm,会有奇奇怪怪的问题;需要将nodejs加入环境变量
prefix=D:\env\nodejs
cache=D:\env\nodejs\cache
registry=https://registry.npm.taobao.org/
sass-binary-site=http://npm.taobao.org/mirrors/node-sass
安装node-gyp
npm install node-gyp -g
node-gyp install
node-gyp list
安装vs2017和python2.7
# 方法一
npm install --global --production windows-build-tools
# 方法二
如果方法一下载很慢,可自行下载vs2017和python2.7
不管是方法一和方法二,都需要将python2.7加入环境变量