安装windows-build-tools
需要使用管理员运行cmd
npm install -g windows-build-tools
在系统环境变量 PATH 中添加python路径
一般在C:\Users\Administrator.windows-build-tools\python27
在npm 配置python
npm config set python C:\Users\Administrator\.windows-build-tools\python27
最后在运行 npm install 命令之前,可以先清除 npm 的缓存,然后再运行命令
npm cache clean --force
npm install