-
Notifications
You must be signed in to change notification settings - Fork 29.8k
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
Windows installer automatically uninstalls previous (LTS) version #35382
Comments
Not commenting one way or another on the validity of the issue, and I might be telling you something you already know, but if you want a quick solution, you can consider a Windows-compatible version manager like nvs or nvm-windows. |
@nodejs/platform-windows @nodejs/build (We need more focused teams to ping for the installers, I suspect.) |
For some history, side by side installs has been previously requested, #4603. There is (was?) a version management group to look at how Node.js gets installed and their discussion on this is recorded in nodejs/version-management#16. |
That would be @nodejs/version-management. I thought they were for version managers, and not the installers that we create, but even if that's so, it's certainly all tied together.... |
Indeed, the group is not for the installers, that's the build or release groups i think? Currently, the supported node installers always and only install a single version, and always uninstall an existing version to install the requested one. |
It does not appear that there's anything further to do on this issue. The installer is operating as it was designed. We've talked about introducing a version manager in the past but haven't been able to make progress. Closing but we can reopen if folks feel the need to revisit. |
No problem. I've already uninstalled the official node package. Going forward I'll simply utilize the version included with graalvm. Maybe the reason the project has been unable to make progress is because issues like this are closed instead requesting (public) comment? The internet was built on RFCs. How about the implementation of a option in the installer, which alerts the user, allowing for installation in a separate folder, or an automatic uninstall (if they decline)? It could even be implemented as a command-line switch. |
Those capabilities already exist in the many existing node version managers. |
@ljharb Why doesn't this capability exist within the official node installer? I feel that it's burdensome to require a 3rd-party package to add one (relatively small and standard?) feature to node's installation. |
Because in practice, it is not small at all, or necessarily standard in other ecosystems. Even the installer allowing these things opens up a very wide range of possible edge cases and bugs, and would impose a quite large maintenance cost on node itself. I maintain nvm, one of the most popular node version managers, and i can assure you there is nothing remotely simple or small about this feature. |
@ljharb Complexity, like the elephant in the room, can be dissected and eaten one bite at a time. Many software package installers allow the ability to "customize" the install. Allowing the program to install into a non-default folder is probably, far and wide, the single most prevalent customization feature available in Windows applications, today. What is it about node which prevents this otherwise small and standard feature to be implemented? |
If you consider it to be so small, then I'd invite you to write a pull request adding it. |
A pull request isn't the optimal place to have a discussion about potential features. Instead of closing issues, like this, I've found it much better to simply de-prioritize them and leave the ledger of discussion available (and therefore much less fragmented). When pull requests get rejected the entire thread gets thrown out. So only discussion around a particular implementation belongs with its respective pull request. If it's not so small could you please (briefly) list the primary impediments in allowing a second installation, into a separate folder? |
As an aside, some kind of RFC process is under discussion (which is not the same as "will definitely happen"): nodejs/TSC#962 |
Pull requests are always welcome, and are always given the priority over expectations that someone else should implement something you want. When it comes to node.js version management, there are few here if any who understand the problem better than @ljharb, so if he says it's complicated it probably is.
|
In case that comes across as a bit flippant, I'd say:
For a more incremental approach, we'd need a map of the incremental steps. Or at least a plausible guess as to what the first incremental step is. |
I'd think the primary (incremental) step is the discussion we're currently having.
Can we break this down into a few specifics? For instance, I know that (3rd-party?) module handling was mentioned in another thread. |
I personally don't fully understand the support implications of having an installer that supports having multiple versions installed on Windows. So I rely upon the opinions of @nodejs/platform-windows and @nodejs/version-management folks on that stuff. However, that said, yeah, I can't imagine implementing this without a clear plan for how to deal with global modules. With a per-user version manager like With a system install, there's tons of prior art to look at to see how "which global modules directory to use" is solved. (I'd guess most revolve around having one or more symlinks in places like Since this is still being actively discussed, I'm going to re-open this. We can always close it again later if a decision of |
By the way, just in case it's not obvious, I'm not trying to say the problem is unsolvable. Just that there needs to be rough consensus on the suitability of whatever solution is chosen. And I realize that what I wrote above (with |
Thanks @Trott! I just wanted a banana or two but you gave me a gorilla and the entire jungle! Python keeps its modules (on Windows) under the same folder structure as the binary/program installation -- which is installed, by default, into a folder based on a Could it make sense for Node, going forward, to install global modules (by default, on Windows) in a similar fashion --under the same (versioned?) folder as the program binaries? (It might already do this, as my |
Global modules can’t be safely shared across node versions, so that would be a strict requirement. |
Thanks @ljharb. Are there any other foreseeable (potential) impediments? |
Node and npm are mostly used as command-line programs. If there are multiple versions installed, which one is going to be executed when the user writes |
Python's Node could use a similar naming scheme and the Windows installer could continue to add the location of the executables to the A more elaborate scheme could be devised but probably best to keep it simple, at least initially? |
This conversation is moving towards just reinventing the existing package managers that are out there. Would it not be more productive just to revisit the decision to bring in one of those existing things into core and iterating from there? |
I'm not sure that's correct. My impression is that most of the version managers have per-user use as the primary use case. ( |
I believe that’s correct; however, that tends to be because it’s more useful to have per-user versions rather than systemwide ones (and removes permissions constraints). |
What if the Windows installer simply asks the user to confirm the uninstallation of the prior install? If they confirm then everything continues to uninstall/install as usual. If they deny then they are given the chance to change the install folder. As long as the install folder points to a prior install (as it currently does, by default) then they will either need to confirm, or deny and select a different folder. No need for versioned executables or scripts. The installer could automatically update the The silent uninstall is frustrating and unexpected behavior. |
I think the simplest compromise is to just download stand-alone binaries (or zips) and entirely bypass the installer. Thanks! |
What steps will reproduce the bug?
How often does it reproduce? Is there a required condition?
It automatically happens during installation on Windows.
What is the expected behavior?
I expect it NOT to uninstall (or at least ask me if I want to uninstall) the currently installed LTS version.
What do you see instead?
The LTS version and its installation folder are completely removed from the system, without warning.
Additional information
The existing behavior doesn't allow me to temporarily install the latest/current version, on an LTS based system, in order to see if an issue has been corrected -- before reporting a bug.
The text was updated successfully, but these errors were encountered: