Error while trying to start the application (or package or make) due to some pyhton error :
At some point of running the electron-forge script I ended up by having this problem, the script was trying to run this command :
node "C:\\Users\\Me\\AppData\\Roaming\\npm\\node_modules\\electron-forge\\node_modules\\node-gyp\\bin\\node-gyp.js" "rebuild" "--target=3.0.0" "--arch=x64" "--dist-url=https://atom.io/download/electron" "--build-from-source"
gyp info it worked if it ends with ok
gyp info using [email protected]
gyp info using [email protected] | win32 | x64
gyp ERR! configure error
gyp ERR! stack Error: Command failed: C:\Users\Me\AppData\Local\Programs\Python\Python37-32\python.EXE -c import sys; print "%s.%s.%s" % sys.version_info[:3];
gyp ERR! stack File "<string>", line 1
gyp ERR! stack import sys; print "%s.%s.%s" % sys.version_info[:3];
gyp ERR! stack ^
gyp ERR! stack SyntaxError: invalid syntax
gyp ERR! stack
gyp ERR! stack at ChildProcess.exithandler (child_process.js:276:12)
gyp ERR! stack at emitTwo (events.js:126:13)
gyp ERR! stack at ChildProcess.emit (events.js:214:7)
gyp ERR! stack at maybeClose (internal/child_process.js:915:16)
gyp ERR! stack at Socket.stream.socket.on (internal/child_process.js:336:11)
gyp ERR! stack at emitOne (events.js:116:13)
gyp ERR! stack at Socket.emit (events.js:211:7)
gyp ERR! stack at Pipe._handle.close [as _onclose] (net.js:561:12)
gyp ERR! System Windows_NT 10.0.17134
gyp ERR! command "C:\\Program Files\\nodejs\\node.exe" "C:\\Users\\Me\\AppData\\Roaming\\npm\\node_modules\\electron-forge\\node_modules\\node-gyp\\bin\\node-gyp.js" "rebuild" "--target=3.0.0" "--arch=x64" "--dist-url=https://atom.io/download/electron" "--build-from-source"
gyp ERR! cwd C:\Users\Me\Documents\management
gyp ERR! node -v v8.12.0
gyp ERR! node-gyp -v v3.8.0
gyp ERR! not ok
[email protected]
[email protected]
Windows 10
Rebuilding native node modules requires node-gyp, which requires Python 2. Install Python 2 and make sure it's first in %PATH% (i.e., before Python 2.7 that you have installed) so node-gyp can find it.
Most helpful comment
Rebuilding native node modules requires node-gyp, which requires Python 2. Install Python 2 and make sure it's first in
%PATH%(i.e., before Python 2.7 that you have installed) so node-gyp can find it.