meta-package-manager icon indicating copy to clipboard operation
meta-package-manager copied to clipboard

Managing multiple versions of the same package manager

Open metasean opened this issue 2 years ago • 5 comments

(A) I can't believe that I just stumbled across this!

(B) Is there a way to manage multiple versions of the same package manager, ala nvm for npm? This is needed when different end consumers need a different version of the same package manager. If there's already a way to do this, I apologize for missing it in the documentation.

metasean avatar Apr 28 '22 15:04 metasean

Hmmm. I'm not sure I understand what you mean by a way to manage multiple versions of the same package manager. Do you mean something like the following?

  1. you have multiple version of npm installed on your machine
  2. you want mpm to have the capability of autodetected all the version of npm installed (by nvm or whatever)
  3. you then want mpm to "navigate" to the context of each npm version and activate it (again, maybe via nvm, I don't know that tool)
  4. for each of this context, have mpm runs its usual operations like listing outdated packages or upgrade them

Is that what you're looking for?

kdeldycke avatar Apr 29 '22 18:04 kdeldycke

Is that what you're looking for?

Yep.

A lot of individual projects require different versions of the same packages, to include different versions of the package managers themselves.

nvm is an awesome tool that enables node developers to have multiple versions of node on their system and to specify per terminal and per project which version to use. There's always a default version (e.g. nvm install v14.19.1 -> Now using node v14.19.1 (npm v8.8.0)), but a user can install and use a different version via the command line (e.g. nvm install --lts && nvm use --lts -> Now using node v16.15.0 (npm v8.5.5), i.e. the most current "long term support" version) or by including an .nvmrc file with the version and invoking nvm use in the corresponding project's directory (e.g. nvm install v14.8.0 && echo "v14.8.0" > .nvmrc && nvm use -> Now using node v14.8.0 (npm v6.14.7)).

Each of these also result in a different set of global npm packages. For example, if I were to npm install -g cowsay while using node v14.8.0 and then I ran nvm use --lts the cowsay package would no longer be available, because it wasn't installed in the node v16.15.0 scope.

I'm most familiar with the node ecosystem, but I know that this problem isn't limited to that ecosystem.

metasean avatar Apr 29 '22 22:04 metasean

Note: I experienced this situation with Python my machine, as I had Python 3.10 installed as python3 command and Python 3.9 available as python. So yes, even if it is not the usual situation, it can happens and it is not unreasonable to have mpm identify and handle this case.

kdeldycke avatar Jun 25 '22 11:06 kdeldycke

Looking for multiple versions and variants of the same executable might also be necessary to solve the way Microsoft in placing dummy files on Windows to invite users to install popular tools by the way of its App Store: https://github.com/kdeldycke/meta-package-manager/issues/927#issuecomment-1427041762

kdeldycke avatar Feb 20 '23 06:02 kdeldycke

Also relates to: #945

kdeldycke avatar Feb 20 '23 07:02 kdeldycke