-
Notifications
You must be signed in to change notification settings - Fork 98
Non-Prerelease Modules do not install over Prerelease versions without -force #83
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
Comments
This should fail, but not silently, based on normal PSGet handling of installing a newer version with Install-Module (I think). If I am missing something, please help me figure it out... 0.7.1 posh-git PSGallery Provides prompt with Git status summary informat... PS C:\WINDOWS\system32> get-installedmodule posh-git 0.5.0.2015 posh-git PSGallery A set of PowerShell scripts which provide Git/Po... PS C:\WINDOWS\system32> install-module posh-git |
@JKeithB Your example has different version numbers.. mine is when the version number is the same, but one is a pre-release version. You get no prompt about the module being present already when you try install the module again. Side by side won't work in this case, because as far as PowerShell is concerned, the modules have the same version. The pre-release information is only part of the nuget package. |
@smurawski do understand the difference. Good feedback, and thanks. |
@smurawski Had to modify this after the initial posting to cover all cases, including the specific instance you listed. Ignoring prerelease versions for a moment, when a version X of a module exists on the system, and a version X+ is the higher-level version that's available, then: With prerelease versioning, in the docs we describe Prerelease versioning impact on sort order and installation folders. In that we explain that: Following these rules: if prerelease version X-S1 is installed, and prerelease X-S2 is the current max version available: And the same behavior if prerelease X-S1 is installed, and stable version X with no prerelease string is the current max version available: |
Ohhhh nooooo .... This won't work AT ALL if your module has a binary and is loaded in any PowerShell session. Also, it affects installs of other pre-release versions as well as the eventual final release. Real world example: PSReadLine 2.0.0-beta2 just got released, and can't be installed by anyone using the previous beta. |
@edyoung we need to get this fixed before PSReadLine 2.0.0 release |
That's an interesting one. Because the install path only has the base version in its name, eg C:\Program Files\WindowsPowerShell\Modules\PSReadline\2.0.0, upgrading beta1 to beta2 wants to overwrite the files - which it can't if the files are open. Not too sure what the options are to fix, will have to think about it. We can't unload DLLs from the running process, and I don't think we have a ton of freedom to rename these files. Particularly awkward for PSReadLine, since it gets autoloaded. A lousy workaround: close all powershell windows and from cmd.exe run |
@SteveL-MSFT I believe PowerShell/PowerShell#2983 would be best way to resolve - then psreadline-2.0.0-beta1 would be installed in a separate directory from psreadline-2.0.0-beta2 because the dir would include the full SemVer. If we can't fix in the interim I think it would make sense to release the next production build of PSReadLine as 2.0.1 instead of 2.0.0 - goofy, I know. |
This works now and will be resolved by PR #523 to be released in 3.0.12 preview release soon. You still can't install two versions side by side which have the same powershell version part (i.e 2.2.0-beta1 and 2.2.0-beta2 and 2.2.0 all have the same powershell version part. But installing a stable version over prerelease one won't require force: |
The new prerelease support allows for prerelease naming of the package, but that doesn't reflect at all on PowerShell's versioning.
If I install module foo with a version of 2.0.0-beta1 (and powershell version 2.0.0), then later try to install foo 2.0.0, the second module install will silently fail.
Expected Behavior
Installing the released version of a module should supercede the prerelease version.
(this would likely also impact other pre-release versions - i.e. upgrading from beta1 to beta2)
Current Behavior
Attempting to install the released version over a pre-release fails silently.
Steps to Reproduce (for bugs)
The text was updated successfully, but these errors were encountered: