记录 electron node-gyp报错解决

Posted ybixian

tags:

篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了记录 electron node-gyp报错解决相关的知识,希望对你有一定的参考价值。

参考1:[https://github.com/nodejs/node-gyp#installation]
参考2:[https://github.com/Microsoft/nodejs-guidelines/blob/master/windows-environment.md#compiling-native-addon-modules]

1,npm install node-gyp -g // (已经装的卸载重新装)

2,npm install --global --production windows-build-tools // c++环境; 以管理员身份运行cmd [--2017]加这个参数为2017版本

3, node-gyp configure --msvs_version=2017 // 设置node-gyp使用的是2017版本,看你本装装的是哪个版本,有2015的

4,npm config set msvs_version 2017 // 设置npm对应的 windows-build-tools 版本,yarn同理吧
5,npm config set python python2.7 // 设置python版本,yarn同理吧

以上是关于记录 electron node-gyp报错解决的主要内容,如果未能解决你的问题,请参考以下文章

Electron-builder“The process cannot access the file because it is being used by another process.”((代

安装bcrypt报错node-gyp rebuild解决方法

nodejs/electron-forge/node-gyp:在尝试了我可以在网上找到的所有提示后,找不到任何要使用的 Visual Studio 安装

Electron相关知识以及实践

报错记录解决Junit测试报错Failed to retrieve PlatformTransactionManager for @Transactional test: [DefaultTest(代

Windows 使用 node-gyp