On #2, I just tried the Obvious Thing of running the commands listed in the OP on my Windows machine (ordinary Windows command prompt, not MinGW or WSL or anything of the sort). Here is what happened.
The npm install command failed. What I believe to be the first informative line of the error message said Error: Can’t find Python executable “python”, you can set the PYTHON env variable. Indeed I don’t have a PYTHON environment variable set. A bit of googling suggests that on systems where it is set it ought to point to the Python executable. So I said set PATH=C:\ProgramData\Anaconda3\python.exe which is where my Python interpreter lives, and I got the same error except that it said Can’t find Python executable “C:\ProgramData\Anaconda3\python.exe” which, since that file is definitely there, I took to mean that it failed to work in some way.
I tried doing the same from an “Anaconda prompt” (i.e., a command prompt with all environment variables set up suitably) and it failed in pretty much the same way except that it had ”.EXE” instead of ”.exe” at the end of the Python executable name it said it couldn’t find.
Perhaps we need Python 2 rather than Python 3. So I installed Python 2.7.15 (vanilla install from python.org rather than via Anaconda), set PYTHON=C:\Python27\python.exe, and tried again. This time it apparently worked, though there were a bunch of warnings.
Then npm start failed completely, because it tries to run a bash script. Oh well, never mind.
Next try: launch a WSL bash prompt, cd /mnt/c/Users/… and try again from the top. My Ubuntu-inside-Windows doesn’t have any version of Python installed by default, so sudo apt install python-minimal (which uses Python 2 rather than Python 3) before proceeding.
Now running npm install fails in a different and more immediate way: before it even tries to do anything, three error messages, two of which are … not found and the last of which is Syntax error: word unexpected (expecting “in”). I think what’s happening is that my pseudo-Linux shell is trying to run npm from my Windows installation of npm, and then getting confused by DOS-style line endings or something of the kind. (There is quite good evidence for this in the actual error messages.)
Next try: install nodejs and npm inside pseudo-Linux and try again. The result is the same, which doesn’t make any sense to me.
So, current suggestion: step 0 is “Be running Linux or macOS” for now. May also need “make sure you have Python 2 installed”?
I’ll continue trying to get it working later, but right now I’m at work and need to be doing other things :-).
Continuing attempts on WSL under Windows 10. I killed the bash prompt I had, and started a new one. This now seems to find the correct version of npm in preference to my Windows one, and npm install no longer fails instantly.
Unfortunately, it does still fail. After downloading a bunch of things, I get a bunch of errors associated with something called chromedriver. The first error message line says ERR! Linux-4.4.0-17134-Microsoft. Perhaps this means something has tried to figure out what sort of system it’s running on and doesn’t recognize what WSL reports? Possibly-informative later lines of the error message say ERR! code ELIFECYCLE and ERR! errno ENOENT. I can’t find anything in the node_modules directory relating to chromedriver; perhaps when something fails to install npm destroys the evidence? Scrolling back, I see that there’s an earlier sign of trouble: a line of the form > chromedriver@2.38.3 install [path to chromedriver module] (note: that path no longer exists in my filesystem) followed by a line of the form > node install.js followed by a blank line and then sh: 1: node: not found. After that comes a line beginning with “Vulcan” and then a big tree diagram of modules, then some dependency-related warnings, and then the errors I mentioned above.
[EDITED to add:] It turns out that on Ubuntu (which is the particular flavour of WSL I’m using) the nodejs package doesn’t provide a node executable because there’s another Ubuntu package that wants to call its executable node. So you need to install nodejs-legacy which I think just makes there be a symlink. And with that, npm install completes.
Now, of course, npm start fails. Meteor gets installed, we get a proxy started, but then three lots of Unexpected mongo exit code 100. Restarting. and some guesses at what Mongo might be unhappy about. And, actually, one of them looks super-plausible: this is all happening in an ordinary-Windows directory (via /mnt/c/… on WSL) and “MongoDB does not support filesystems like NFS that do not allow file locking.” So, time to put the whole thing inside WSL-land and see if it fares any better, I guess.
When the npm install option results in some errors, what I find most helpful is to try to install those things individually (where you can focus on just the errors relevant to a single thing)
So my next step if this were my machine would be:
1. look up the version of chromedriver it’s trying to install (in the package.json file)
2. I can see that it’s chromedrive@r^2.34.1
3. Try npm install chromedriver@^2.34.1
4. See what errors come up, do a google search for those errors and see if you find anything useful on stack overflow
You can resolve individual failed-to-download packages individually, and once you’ve done that for each package throwing errors, npm start should work.
Very much appreciate both giving it a try and then putting a fair chunk of effort into debugging.
Elo tried installing yesterday on Linux and didn’t actually get it up and running either, and upon reflection everyone I know who’s gotten it running locally has been using a mac. Linux should hopefully be easier to debug than Windows.
Meanwhile I’ll update this post with the “step 0”. I think once we’ve gotten a couple people who had troublesome installs to work properly I’ll do some more documentation about best-practices-for-install-troubleshooting.
npm install gave out a lot of warnings about outdated packages, I don’t know if they were talking about my preexisting environment or about something in the LW2 repo.
npm start took over half an hour before I went away, and when I came back many hours later it seemed to be stuck in a loop of constantly retrying something that was throwing an error.
I will also take a moment to grump that prestart_lesswrong.sh installs meteor, which I would rather have done myself (and which I wouldn’t have done through curl | bash). Still, I understand that having an easy setup makes people more likely to contribute, so I won’t grump too much. I would have appreciated a warning though, or a separate npm install_deps script or something.
On #2, I just tried the Obvious Thing of running the commands listed in the OP on my Windows machine (ordinary Windows command prompt, not MinGW or WSL or anything of the sort). Here is what happened.
The npm install command failed. What I believe to be the first informative line of the error message said Error: Can’t find Python executable “python”, you can set the PYTHON env variable. Indeed I don’t have a PYTHON environment variable set. A bit of googling suggests that on systems where it is set it ought to point to the Python executable. So I said set PATH=C:\ProgramData\Anaconda3\python.exe which is where my Python interpreter lives, and I got the same error except that it said Can’t find Python executable “C:\ProgramData\Anaconda3\python.exe” which, since that file is definitely there, I took to mean that it failed to work in some way.
I tried doing the same from an “Anaconda prompt” (i.e., a command prompt with all environment variables set up suitably) and it failed in pretty much the same way except that it had ”.EXE” instead of ”.exe” at the end of the Python executable name it said it couldn’t find.
Perhaps we need Python 2 rather than Python 3. So I installed Python 2.7.15 (vanilla install from python.org rather than via Anaconda), set PYTHON=C:\Python27\python.exe, and tried again. This time it apparently worked, though there were a bunch of warnings.
Then npm start failed completely, because it tries to run a bash script. Oh well, never mind.
Next try: launch a WSL bash prompt, cd /mnt/c/Users/… and try again from the top. My Ubuntu-inside-Windows doesn’t have any version of Python installed by default, so sudo apt install python-minimal (which uses Python 2 rather than Python 3) before proceeding.
Now running npm install fails in a different and more immediate way: before it even tries to do anything, three error messages, two of which are … not found and the last of which is Syntax error: word unexpected (expecting “in”). I think what’s happening is that my pseudo-Linux shell is trying to run npm from my Windows installation of npm, and then getting confused by DOS-style line endings or something of the kind. (There is quite good evidence for this in the actual error messages.)
Next try: install nodejs and npm inside pseudo-Linux and try again. The result is the same, which doesn’t make any sense to me.
So, current suggestion: step 0 is “Be running Linux or macOS” for now. May also need “make sure you have Python 2 installed”?
I’ll continue trying to get it working later, but right now I’m at work and need to be doing other things :-).
If you try again, I think you can avoid needing bash. See my comment here.
Continuing attempts on WSL under Windows 10. I killed the bash prompt I had, and started a new one. This now seems to find the correct version of npm in preference to my Windows one, and npm install no longer fails instantly.
Unfortunately, it does still fail. After downloading a bunch of things, I get a bunch of errors associated with something called chromedriver. The first error message line says ERR! Linux-4.4.0-17134-Microsoft. Perhaps this means something has tried to figure out what sort of system it’s running on and doesn’t recognize what WSL reports? Possibly-informative later lines of the error message say ERR! code ELIFECYCLE and ERR! errno ENOENT. I can’t find anything in the node_modules directory relating to chromedriver; perhaps when something fails to install npm destroys the evidence? Scrolling back, I see that there’s an earlier sign of trouble: a line of the form > chromedriver@2.38.3 install [path to chromedriver module] (note: that path no longer exists in my filesystem) followed by a line of the form > node install.js followed by a blank line and then sh: 1: node: not found. After that comes a line beginning with “Vulcan” and then a big tree diagram of modules, then some dependency-related warnings, and then the errors I mentioned above.
[EDITED to add:] It turns out that on Ubuntu (which is the particular flavour of WSL I’m using) the nodejs package doesn’t provide a node executable because there’s another Ubuntu package that wants to call its executable node. So you need to install nodejs-legacy which I think just makes there be a symlink. And with that, npm install completes.
Now, of course, npm start fails. Meteor gets installed, we get a proxy started, but then three lots of Unexpected mongo exit code 100. Restarting. and some guesses at what Mongo might be unhappy about. And, actually, one of them looks super-plausible: this is all happening in an ordinary-Windows directory (via /mnt/c/… on WSL) and “MongoDB does not support filesystems like NFS that do not allow file locking.” So, time to put the whole thing inside WSL-land and see if it fares any better, I guess.
When the
npm install
option results in some errors, what I find most helpful is to try to install those things individually (where you can focus on just the errors relevant to a single thing)So my next step if this were my machine would be:
1. look up the version of chromedriver it’s trying to install (in the package.json file)
2. I can see that it’s chromedrive@r^2.34.1
3. Try
npm install chromedriver@^2.34.1
4. See what errors come up, do a google search for those errors and see if you find anything useful on stack overflow
You can resolve individual failed-to-download packages individually, and once you’ve done that for each package throwing errors,
npm start
should work.Very much appreciate both giving it a try and then putting a fair chunk of effort into debugging.
Elo tried installing yesterday on Linux and didn’t actually get it up and running either, and upon reflection everyone I know who’s gotten it running locally has been using a mac. Linux should hopefully be easier to debug than Windows.
Meanwhile I’ll update this post with the “step 0”. I think once we’ve gotten a couple people who had troublesome installs to work properly I’ll do some more documentation about best-practices-for-install-troubleshooting.
It didn’t work for me on linux either.
npm install
gave out a lot of warnings about outdated packages, I don’t know if they were talking about my preexisting environment or about something in the LW2 repo.npm start
took over half an hour before I went away, and when I came back many hours later it seemed to be stuck in a loop of constantly retrying something that was throwing an error.I will also take a moment to grump that
prestart_lesswrong.sh
installs meteor, which I would rather have done myself (and which I wouldn’t have done throughcurl | bash
). Still, I understand that having an easy setup makes people more likely to contribute, so I won’t grump too much. I would have appreciated a warning though, or a separatenpm install_deps
script or something.