在用renrenfast-vue,快速搭建系统的时候,遇到几个问题:
1、ERR! configure error gyp ERR! stack Error: Can't find Python executable "python"
原因:我本地是python3.8,这个npm依赖的包需要python2.7。
解决方法:下载python2.7,安装,然后运行npm install 的时候指定下python版本。
// 设置config
npm config set python C:\Program Files\Python27
// 重新执行npm
npm install
2、MSBUILD : error MSB4132: 无法识别工具版本“2.0”。可用的工具版本为 "14.0", "4.0"。
上面解决后,又遇到这个问题。
解决办法:
- 下载VC++ tool http://go.microsoft.com/fwlink/?LinkId=691126&
- 默认安装
- npm config set msvs_version 2015
- npm i
3、node-sass 安装失败“v8::String::Utf8Value”
这个问题是由于版本不对应导致的,需要根据node和npm的版本指定要安装的node-sass版本。node-sass和node支持的对应版本可以在github node-sass查看。
我的node版本是12.6.1,所以对应的node-sass版本是4.12+。然后我们去renrenfast-vue里面的package.json里面修改版本。如下,
然后重新 npm install,最终编译通过,哈哈。