meta-package-manager
meta-package-manager copied to clipboard
Managing multiple versions of the same package manager
(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.
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?
- you have multiple version of
npm
installed on your machine - you want
mpm
to have the capability of autodetected all the version ofnpm
installed (bynvm
or whatever) - you then want
mpm
to "navigate" to the context of eachnpm
version and activate it (again, maybe vianvm
, I don't know that tool) - 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?
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.
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.
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
Also relates to: #945