1

This question was created from issues I've encountered while trying to install jsbin locally. JGallardo has asked me to create a question from it, because originally I've posted comments in the original Q&A (please follow the link to see what it was about).

Update: Since the Windows tag has been removed by reviewers, let me note that I am having the issues on a Windows 7 machine.

The command npm install jsbin don't work for me - it throws an error I don't understand: "npm ERR! Error: getaddrinfo EAGAIN npm ERR! at errnoException (dns.js:37:11) npm ERR! at Object.onanswer [as oncomplete] (dns.js:124:16)"

I've set up a proxy server, which is required in my case as I found: npm config set proxy=http://servername:port. Now it is fetching files, when I call npm install jsbin into the "c:\users\myuser\AppData\Roaming\npm-cache" directory - but it is running very long. Now it is saying "can't find python executable" - do you know which dependency this is? How can I install the python package if that is required?

After getting the error above, I have also tried to install npn install python before running npn install jsbin. It also did not work, I am still getting the error "Error: Can't find Python executable "python", you can set the PYTHON env variable."

Can you help to get jsbin installed locally? Why can't npm find the python package although it seems to be installed?

N.B. I now have also installed the official Python interpreter from the official source and verified that it is available through the pathenvironment variable:

Your environment has been set up for using Node.js 0.10.12 (x64) and npm.

C:\>python
Python 3.3.2 (v3.3.2:d047928ae3f6, May 16 2013, 00:06:53) [MSC v.1600 64 bit (AMD64)] on win32
Type "help", "copyright", "credits" or "license" for more information.
>>>

Also, I've set up the PYTHONenvironment variable to the path C:\Python33 where the python system was installed to.

The error I am getting is:

gyp ERR! configure error
gyp ERR! stack Error: spawn ENOENT
gyp ERR! stack     at errnoException (child_process.js:980:11)
gyp ERR! stack     at Process.ChildProcess._handle.onexit (child_process.js:771:34)
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" "rebuild"
gyp ERR! cwd C:\Python33\node_modules\jsbin\node_modules\bcrypt
gyp ERR! node -v v0.10.12
gyp ERR! node-gyp -v v0.10.0
gyp ERR! not ok
Matt
  • 25,467
  • 18
  • 120
  • 187
  • I have to ask, and I apologize. Is the python.exe on your system path? – K.Niemczyk Nov 14 '13 at 22:10
  • @K.Niemczyk - Good question! `npm install python`downloads a python package which is created in the npm-cache. Inside `C:\Users\...\npm-cache\python\0.0.2\package\lib` there is a `python.js` file, but no `python.exe`. I don't know the purpose of this lib, but it seems to be too small for a complete python interpreter. – Matt Nov 15 '13 at 08:03
  • I'd recommend manually putting the path to a python interpreter on your sys path and retry it. Sometimes these things are head slappers in retrospect. – K.Niemczyk Nov 15 '13 at 15:21
  • @K.Niemczyk: I've updated my question - Python is installed, available in the path but the issues are still there. – Matt Nov 15 '13 at 16:14
  • Hmm: Have you consulted [this](http://stackoverflow.com/questions/15126050/running-python-on-windows-for-node-js-dependencies?rq=1) question? Sounds like a similar problem. – K.Niemczyk Nov 15 '13 at 16:18
  • @K.Niemczyk: Thank you for sharing the link, I've tried it but in my case there is still an error (see my update to the question). – Matt Nov 18 '13 at 08:29
  • One more thing. I wonder if jsbin has a hidden dependency on the npm python module (npm install python). That module seems to focus on interacting with long-running child processes, which seems 'promising'. I'll give it a whirl tonight when I get home to see if I can duplicate what you have going here. – K.Niemczyk Nov 19 '13 at 23:02
  • That would be great, thank you! – Matt Nov 20 '13 at 12:09
  • I tried on two platforms, OSX and Windows 7. OSX worked fine and I can run jsbin without problems. On windows it failed but it looks more due to the fact that I'm missing other stuff that the dependencies of jsbin require. Unfortunately, I don't think I can attempt to help much further. Good luck. – K.Niemczyk Nov 20 '13 at 16:31
  • @K.Niemczyk: Thank you for your efforts. At least I know now that it is a platform (Windows) related issue. – Matt Nov 21 '13 at 08:33
  • @Matt did you end up getting it working? I'm running into the same issue. Is it related to the "gyp ERR! System Windows_NT..." because I am on Windows 8.1 – woojoo666 Dec 22 '13 at 19:54
  • @woojoo666: No, unfortunately not. I don't know what else I could try. In my case, it is Win7/64 bit. – Matt Dec 23 '13 at 07:22
  • I was able to find a solution [here](https://github.com/remy/jsbin/issues/353#issuecomment-30627120). Remember to install OpenSSL first, and hope it works for you! – woojoo666 Dec 23 '13 at 10:04
  • @woojoo666: I've installed [GitHub for Windows](http://windows.github.com/), then I tried `git clone https://github.com/remy/jsbin.git` as described in the [post](https://github.com/remy/jsbin/issues/353#issuecomment-30627120) but got the error `fatal: unable to access 'https://github.com/remy/jsbin.git/': Could not resolve host: github.com` – Matt Dec 23 '13 at 10:44
  • hmm, perhaps a firewall or something? Did u try using the powershell provided by the github app? – woojoo666 Dec 23 '13 at 12:20
  • @woojoo666: I used the GitShell to invoke the command above. – Matt Dec 23 '13 at 15:45
  • can you git anything else? [this](http://www.dexterindustries.com/forum/?topic=error-couldnt-resolve-host-github-com) says it might be a problem with the internet. Well if all else fails I'm sure you can just download the repo as a zip from the right-panel of [the jsbin github page](https://github.com/remy/jsbin)) – woojoo666 Dec 23 '13 at 23:08

1 Answers1

0

I could not find out why NPN wasn't installing python, but then I tried it with a different installer, choco (or Chocolatey), which succeeded.

Steps are:

  1. Install Chocolatey. See Chocolatey website for instructions
  2. Open administrator console, then do the following:

C:\WINDOWS\system32>choco install python

!!ATTENTION!!
The next version of Chocolatey (v0.9.9) will require -y to perform
  behaviors that change state without prompting for confirmation. Start
  using it now in your automated scripts.

  For details on the all new Chocolatey, visit http://bit.ly/new_choco
Chocolatey (v0.9.8.33) is installing 'python' and dependencies. 
By installing you accept the license for 'python' and each dependency you are installing.

python v3.4.3
Using this proxyserver: defrceprx02.ey.net:8443
Downloading python 64 bit
  from 'https://www.python.org/ftp/python/3.4.3/python-3.4.3.amd64.msi'
Using this proxyserver: defrceprx02.ey.net:8443
Installing python...
python has been installed.
python has finished successfully! The chocolatey gods have answered your request!
PATH environment variable does not have C:\tools\python in it. Adding...
Finished installing 'python' and dependencies - if errors not shown in console, none detected. 
Check log for errors if unsure.

C:\WINDOWS\system32>

Matt
  • 25,467
  • 18
  • 120
  • 187