If you haven't got python installed along with all the node-gyp dependencies, simply open Powershell or Git Bash with administrator privileges and execute:
npm install --global --production windows-build-tools
and then to install the package:
npm install --global node-gyp
once installed, you will have all the node-gyp dependencies downloaded, but you still need the environment variable. Validate Python is indeed found in the correct folder:
C:Usersen.windows-build-toolspython27python.exe
*Note - it uses python 2.7 not 3.x as it is not supported*
If it doesn't moan, go ahead and create your (user) environment variable:
setx PYTHON "%USERPROFILE%.windows-build-toolspython27python.exe"
restart cmd, and verify the variable exists via set PYTHON
which should return the variable ($env:PYTHON
if using Powershell)
Lastly re-apply npm install <module>
与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…