-
Notifications
You must be signed in to change notification settings - Fork 29
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
JBIDE-20351: Improving Node detection for Ubuntu #507
Conversation
What will happen if there are both "node" (not a node.js package) and "nodejs" (node.js package) available? Which one will be used? Incorrect "node"? If so, shouldn't we look for nodejs on Linux first and if we fail then look for "node"? Is there any good way to distinguish a "fake" node and a real one? |
What do you mean by "fake" ? Both "nodejs" and "node" possible names for Node.js executables |
yes, but on ubuntu it seems you can have both node and nodejs available at the same time and node won't be the right one. |
Exactly. "node" in Ubuntu is usually a command from Amateur Packet Radio Node Program package. Not from Node.JS. It's why they use nodejs. So in Ubuntu, if you have both "node" and "nodejs" then it's more likely that "nodejs" is the right one and "node" is the wrong one. |
Ok got it. Will update PR tomorrow. Need to figure out how to distinguish two of those executables |
Don't forget to add tests for "nodejs"/"node" detection ;) |
got an idea of how to distinguish Amateur Packet Radio Node from Node.js executables. Basically, those two have a significant installed size difference - Amateur Packet Radio Node ~ 34Kb ( http://packages.ubuntu.com/trusty/node) and Node.js ~ 7 - 11 Mb depending on version. So, depending on the file's metadata we can find out whether "node" is trustworthy. WDYT ? |
What I see in your code. If there are both "nodejs" and "node" on Linux then "nodejs" is used. If there is only "node" then you use it only if its size more than 5MB. |
tests are not at all a pain in the butt ;-) I just need a piece of advice how to write good tests for this particular case. I mean how this public detectNode() method can be properly tested ?
|
and one more point here: in order to install native bower user will need to install node.js and npm firstly. So, if he has only Amateur Packet Radio node the error pop-up for "bower update" will be shown anyways, cause bower will not be detected. Once node.js, npm and bower installed the detection will work just fine. |
OK that makes sense. So just using nodejs if it's available will solve the problem. If it's not available then we should look for "node". That's it. |
No description provided.