title: "Can't find Python executable..." - npm install hangs
body: <p>I am using "npm install" to download and compile all the dependencies of a small node.js app I have written. The "package.json" file I am using is correct and contains all the needed information.</p>
  
  <p>One of the packages to be installed has "node-gyp" as a dependency, so I have previously installed the "python2" package.</p>
  
  <p>Now, at a certain point I start getting error messages:</p>
  
  <pre><code>&gt; node-gyp 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 (/usr/lib/node_modules/npm/node_modules/node-gyp/lib/configure.js:103:14)
  gyp ERR! stack     at /usr/lib/node_modules/npm/node_modules/node-gyp/lib/configure.js:42:11
  gyp ERR! stack     at F (/usr/lib/node_modules/npm/node_modules/which/which.js:40:25)
  gyp ERR! stack     at E (/usr/lib/node_modules/npm/node_modules/which/which.js:43:29)
  gyp ERR! stack     at /usr/lib/node_modules/npm/node_modules/which/which.js:54:16
  gyp ERR! stack     at FSReqWrap.oncomplete (fs.js:99:15)
  gyp ERR! System Linux 3.18.9-200.fc21.x86_64
  gyp ERR! command "node" "/usr/lib/node_modules/npm/node_modules/node-gyp/bin/node-gyp.js" "rebuild"
  gyp ERR! cwd /srv/visitor/node_modules/phantom/node_modules/dnode/node_modules/weak
  gyp ERR! node -v v0.12.1
  gyp ERR! node-gyp -v v1.0.3
  gyp ERR! not ok
  npm WARN optional dep failed, continuing weak@0.3.4
  </code></pre>
  
  <p>The issues seems to be that an environment variable is missing. </p>
  
  <p>Can anyone point me in the right direction? No matter where I search on the Internet, there is no mention of a "PYTHON" variable, only "PYTHONPATH" and others like it. What is the correct way to fix this, so that I do not get those errors?</p>
  
  <p><strong>UPDATE 1:</strong></p>
  
  <p>After following advice from this thread I added these commands before executing "npm install":</p>
  
  <pre><code>PYTHON=/usr/sbin/python2
  export PYTHON
  </code></pre>
  
  <p>Now I am getting this error:</p>
  
  <pre><code>&gt; node-gyp rebuild
  
  gyp ERR! build error
  gyp ERR! stack Error: not found: make
  gyp ERR! stack     at F (/usr/lib/node_modules/npm/node_modules/which/which.js:40:28)
  gyp ERR! stack     at E (/usr/lib/node_modules/npm/node_modules/which/which.js:43:29)
  gyp ERR! stack     at /usr/lib/node_modules/npm/node_modules/which/which.js:54:16
  gyp ERR! stack     at FSReqWrap.oncomplete (fs.js:99:15)
  gyp ERR! System Linux 3.18.9-200.fc21.x86_64
  gyp ERR! command "node" "/usr/lib/node_modules/npm/node_modules/node-gyp/bin/node-gyp.js" "rebuild"
  gyp ERR! cwd /srv/visitor/node_modules/phantom/node_modules/dnode/node_modules/weak
  gyp ERR! node -v v0.12.1
  gyp ERR! node-gyp -v v1.0.3
  gyp ERR! not ok
  npm WARN optional dep failed, continuing weak@0.3.4
  </code></pre>
  
  <p>I find it absurd that it says "...not found: make...". Is there any possibility of it being so? If yes, how come packages install correctly?</p>
  
  <p>Frankly, I do not understand a thing. Any ideas?</p>