Reputation: 6184
Not able to install npm package PM2 in windows 7 we are getting below error
> [email protected] install C:\Users\evaith\AppData\Roaming\npm\node_modules\pm2\node_modules\usage
> node-gyp rebuild
C:\Users\evaith\AppData\Roaming\npm\node_modules\pm2\node_modules\usage>node "C:\Program Files\nodejs\node_modules\npm\b
in\node-gyp-bin\\..\..\node_modules\node-gyp\bin\node-gyp.js" rebuild
gyp ERR! configure error
gyp ERR! stack Error: Can't find Python executable "python", you can set the PYTHON env variable.
gyp ERR! stack at failNoPython (C:\Program Files\nodejs\node_modules\npm\node_modules\node-gyp\lib\configure.js:118:
14)
gyp ERR! stack at C:\Program Files\nodejs\node_modules\npm\node_modules\node-gyp\lib\configure.js:81:11
gyp ERR! stack at Object.oncomplete (fs.js:107:15)
gyp ERR! System Windows_NT 6.1.7601
gyp ERR! command "node" "C:\\Program Files\\nodejs\\node_modules\\npm\\node_modules\\node-gyp\\bin\\node-gyp.js" "rebuil
d"
gyp ERR! cwd C:\Users\evaith\AppData\Roaming\npm\node_modules\pm2\node_modules\usage
gyp ERR! node -v v0.10.21
gyp ERR! node-gyp -v v0.10.10
gyp ERR! not ok
npm ERR! weird error 1
npm http 304 https://registry.npmjs.org/keypress
npm ERR! not ok code 0
PS C:\Users\evaith>
Why it looking for Python path.
Upvotes: 2
Views: 3805
Reputation: 59773
PM2 uses native components which require compilation. Many node packages utilize node-gyp (reference) to make building native C/C++ code cross platform more convenient and reliable.
One of the dependencies of node-gyp
is the 2.7.3+ series of Python (3.x is not compatible). So, in order to compile a package that does not already include native binaries or a fall back to JavaScript, you may need Python. But, if you are compiling on Windows, you'll also need to have a compiler. I'd suggest following the instructions on the node-gyp
web page (you'll need to install a free version of Visual Studio).
But, you'll encounter the more serious error later that PM2 isn't supported on Windows ( https://github.com/Unitech/pm2/issues/6?source=cc).
Upvotes: 3
Reputation: 48496
Error: Can't find Python executable "python", you can set the PYTHON env variable.
Install python
? Get it here
Upvotes: 0