-
Notifications
You must be signed in to change notification settings - Fork 7
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
feat: ask to install local node runtime if not available in PATH #51
Conversation
I've tried on Linux and had to switch to downloading The logic with this change is that at first the Node available on PATH will be tried and if it exists and matches the minimum version then it will be used. Otherwise, we'll install a local Node version in Note the Node-based LSP-* packages that define the
to
, for example. Not knowing that detail can confuse you in case you want to test it. |
I was also wondering if the current logic is a good default. I mean, trying Node on PATH first and falling back to the local one. Maybe the local one should be always used instead to make things more consistent and predictable. And maybe there should be a setting to control all that to allow the user to do whatever he/she wants. |
You should have a dialog offering to install this, or have clear docs about this. In any case, installing a runtime in the background, without notice, should be avoided. |
Note that Node 14 will not run on Windows 7. If node 14 must be used, you can skip the platform check via https://nodejs.org/api/cli.html#cli_node_skip_platform_check_value env variable. |
I agree. Only that the available options for showing a prompt to a user are not ideal... I guess the best one to use would be
In that case, I'll probably switch to Node 12 by default. |
I'd say I'm pretty much ready here. The dialog asking to install a local Node is implemented. One thing that I'm thinking about is to remember user's decision permanently when he says not to install Node (for example using a three-button dialog). Not sure where I would store those though (can dependencies have their own *.sublime-settings?) or how the user would then know how to reset that setting. For now, the NO answer is remembered for the session and I'm thinking that if user doesn't want to be reminded on every start then he/she should either uninstall the package or fix the Node on PATH. |
Tested on linux it works as described :)
I wanted also to suggest something to use the But on the other side, the behavior in this PR is great. But on the other side, it takes less than one minute(<40s) to download node. Is it possible to implement some way of cleanup logic(delete the node dist path, if no longer needed)? |
It's a bit hard to understand what you mean here. :)
It should be easy to implement now but could prove difficult if I decide to support installing multiple versions. I'm thinking that it would be worth supporting a behavior where if a package specifies a minimum node version higher than the default one, we would install that one also. |
It was late and I was tired, hahaha, sorry for that message above :) Basically my concern was that I thought that the current logic was maybe complex.
I wanted to suggest to always install node in the But I am happy with the current state of this PR. |
f914508
to
6b56839
Compare
Needs to be tested on Linux. On Mac extracting
*.tar.xz
fails in Python 3.3 and I needed to switch to*.tar.gz
. The same might be necessary for Linux.On ST3 Node installation happens on the main thread so that's not ideal.