-
Notifications
You must be signed in to change notification settings - Fork 66
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
Preinstall ps-nvm #1968
Comments
Thanks for letting know about the tool - looks great! Yes,
How does |
If you are interested take a look at the source code, it's just a few hundred lines :) |
Is the I also support the idea of adding nvm to AppVeyor, but it's hard to compare them when we can't see how exactly |
Also now relevant that AppVeyor has Linux support: ps-nvm works on Linux too (I don't know whether |
Currently, |
I like that idea. It could also encourage more participation in nvm for Windows, which seems it could use some resources. |
I think he meant calling into nvm only on Linux. nvm-windows is different project and is architecturally very different (swapping symlinks instead of modifying PATH). Frankly @FeodorFitsner I can't follow the reasoning - what is wrong with using ps-nvm? |
I understand they are different projects. But like nvm for Linux, nvm for Windows is the most reasonable way to install Node. So having Install-Product use whatever nvm is appropriate for the platform seems like a very smart move to me. |
Could you explain why you think nvm-windows is the most reasonable/appropriate for the platform? I personally don't find switching the target of a global symlink very reasonable. Changing PATH seems to make much more sense to me. And installing programs through MSIs also seems more appropriate on Windows to me than downloading binaries into folders. |
Well, we simply don't see eye-to-eye. I like nvm for Windows for exactly the same reason I like nvm for Linux. It sandboxes the entire installation so you don't have to mess with graphical installers or system paths (aside from nvm itself). And so far, my users have been very successful with it, so it proves itself in the real world. But what I was really asking about was finding out what black magic Install-Product does so that we can make a determination as to whether it should even be doing what it does. I don't like that CI installs one way, and that way is not something I can ask users to do. |
Yes, but this issue specifically is about the proposal of bundling ps-nvm, not nvm-windows. ps-nvm sandboxes the installation too, you don't have to mess with a graphical installer or system path either. In fact, nvm-windows itself has a graphical installer, while ps-nvm is simply installed with |
My mistake. I missed what you were trying to tell me. It went right over my head that ps-nvm is different than nvm for Windows. (The risk of reusing the same name). In hindsight, what you were trying to communicate makes complete sense. Sorry for the confusion. So I want to revise the statement I was trying to make. I support the idea of Install-Product using ps-nvm under the covers. (Honestly, I really don't care what nvm clone is used, as long as it has the capabilities that users have come to expect). |
(and I'll look into using ps-nvm for my users now). |
This is the module behind ps-nvm is changing path to selected Node in |
Thanks for posting that. If comparing AVVM vs others, a question that comes to my mind is why isnt AVVM being used for other languages also? I can only find one lang set up in AVVM; being https://appveyordownloads.blob.core.windows.net/avvm/node-versions.txt The only other language guide which recommends some special switcher is With only a little fiddling, I was able to set up python and ruby and miniconda in AVVM. It seems too simple -- yet it hasnt be done. There must be some reason for not using AVVM for these other products? Another option worth assessing is @asdf-vm , which also works on Windows, and some polish for Windows with CI is coming at asdf-vm/asdf#451 . It provides a single version-switching interface for lots of products; see https://github.com/asdf-vm/asdf-plugins#plugin-list . |
Another option is setting up an offline cache of choco packages (e.g. via https://github.com/BahKoo/ChocolateStore ; more at https://stackoverflow.com/questions/18528919/how-to-install-chocolatey-packages-offline), and pre-install some of the common ones. choco allows multiple versions to be installed at the same time (most major packages support this), and it has |
You are all dismissing the reason why I filed this issue, why ps-nvm is better than Install-Product/choco/anything else: It can read your .nvmrc file or package.json |
Can ps-nvm also find/import all of the pre-installed versions of node on AppVeyor, and switch to the correct one? If not, pre-installing (and implicitly recommending) ps-nvm means the existing node installs are being ignored, and a new caching system is needed. |
How would it "find" them? There is no standardized location for multiple Node versions... |
They are MSI's, and have product entries in the registry. |
I don't think it queries a registry, but it does use MSIs for installation on Windows. |
Nope, asdf mentioned earlier does support And adding a |
Yes, but not package.json. |
You can read
If you want to be on the bleeding edge of LTS, you need something like the script below:
This, unfortunately, does not support al |
I wanted to open the discussion on providing a more sophisticated NodeJS version manager out of the box.
Travis has nvm preinstalled and uses it to install versions, which will automatically read .nvmrc files and can install any version of Node.
AppVeyor on the other hand only has
Install-Product
, which seems to be a custom thing? It does not seem to read .nvmrc, and seems to only have a limited selection of versions available.I personally did a lot of work over the past month on ps-nvm, the Node version manager for PowerShell. It's well-tested, has support for .nvmrc (even package.json
engines.node
), can install any Node version and supports npm semver ranges.I think providing it out of the box would make AppVeyor/Windows in general a better platform to develop NodeJS on. It could be provided in addition to
Install-Product
so nothing should break.Would solve #727
Thoughts?
The text was updated successfully, but these errors were encountered: