keybase / node-installer

An installer/updater for the node client.
BSD 3-Clause "New" or "Revised" License
117 stars 9 forks source link

Check for nodejs first to increase predictability #55

Open flickerfly opened 10 years ago

flickerfly commented 10 years ago

On the debian based systems, if the other node app is installed it will break this script by making it think that nodejs is at node, but that's actually another app by the same name. By checking first if nodejs exists, you get around this problem as you never check for the less popular node app that doesn't work and nodejs is less likely to be a conflicting app.

I installed the not so nodejs version of node thinking I was getting nodejs and this caused a great deal of confusion and frustration until I got it straightened out.

maxtaco commented 10 years ago

Out of curiosity, would it work to apt-get install nodejs-legacy? That adds a system-level symlink so that node is the right interpreter name.

flickerfly commented 10 years ago

No, because I accidentally installed the wrong node which caused a conflict with nodejs-legacy once I did come across that suggestion. Since that broke I searched and found another solution, a ppa version without the symlink which didn't conflict with node. Once that is installed it conflicts with nodejs-legacy even if I do uninstall node, which I have. So, unless I knew the smoothest path from the beginning I'd have to tear down everything and start over with my nodejs install. Since I can fix it by adding two letters at the top of two files, I'm hesitant to mess with it and I think my ppa has a newer version of nodejs anyway.

I'm poking around this way for the sake of those who follow down the same path I did to the ppa. It's less about my own desired install as getting it to work on the next guy who finds this awkward way of getting nodejs on ubuntu/debian. I'll probably just create a symlink manually next time I update keybase and overwrite the nodejs in the file with node.

Maybe it's really a documentation problem, but with this patch the script does actually report accurately which binary to use rather than simply believing that having node in the path means it is a workable node. So it's an improvement of code that doesn't actually get run at any point I guess. :-)