felixrieseberg / windows-build-tools

:package: Install C++ Build Tools for Windows using npm
MIT License
3.4k stars 237 forks source link

Fix setting up PATH environment variable #188

Closed bzoz closed 5 years ago

bzoz commented 5 years ago

Npm is modifying process environment variables before running postinstall script. Especially, it adds %APPDATA%\npm\node_modules\npm\node_modules\npm-lifecycle\node-gyp-bin to the PATH variable. This pollutes users PATH variable and for some users breaks node-gyp (e.g.: https://github.com/nodejs/node-gyp/issues/1760, https://github.com/nodejs/node-gyp/issues/1633, but there are more)

This PR makes set-enviroment.ps1 use users variable value (not the current process one) when adding Python to the users PATH variable.

felixrieseberg commented 5 years ago

Ah, that's a good improvement. Thank you!