@@ -72,6 +72,26 @@ IF %ERRORLEVEL% NEQ 0 GOTO ERROR
72
72
IF " %nodejs_version:~0 ,1 % " == " 5" CALL npm install node-gyp@ 3.x
73
73
IF %ERRORLEVEL% NEQ 0 GOTO ERROR
74
74
75
+ :: Need to force update node-gyp to v6+ for electron v6 and v5
76
+ ECHO ===== conditional node-gyp upgrade START ============
77
+ :: Find the folder to install the node-gyp in
78
+ SET npm_in_nodejs_dir = " %ProgramFiles% \nodejs\node_modules\npm"
79
+ ECHO npm_in_nodejs_dir^ : %npm_in_nodejs_dir%
80
+ IF /I " %platform% " == " x86" SET npm_in_nodejs_dir = " %ProgramFiles(x86)% \nodejs\node_modules\npm"
81
+ ECHO npm_in_nodejs_dir^ : %npm_in_nodejs_dir%
82
+ :: Set boolean whether the update has to happen
83
+ SET " needs_patch = "
84
+ IF DEFINED NODE_RUNTIME_VERSION (
85
+ ECHO NODE_RUNTIME_VERSION_REDUCED^ : %NODE_RUNTIME_VERSION:~0 ,1 %
86
+ IF " %NODE_RUNTIME_VERSION:~0 ,1 % " == " 5" SET " needs_patch = y"
87
+ IF " %NODE_RUNTIME_VERSION:~0 ,1 % " == " 6" SET " needs_patch = y"
88
+ )
89
+ :: Check if electron and install
90
+ ECHO NODE_RUNTIME^ : %NODE_RUNTIME%
91
+ IF DEFINED needs_patch CALL npm install --prefix %npm_in_nodejs_dir% node-gyp@ 6.x
92
+ IF %ERRORLEVEL% NEQ 0 GOTO ERROR
93
+ ECHO ===== conditional node-gyp upgrade END ============
94
+
75
95
CALL npm install --build-from-source --msvs_version=%msvs_version% %TOOLSET_ARGS% --loglevel=http
76
96
IF %ERRORLEVEL% NEQ 0 GOTO ERROR
77
97
0 commit comments