Sorry, maybe I was not clear in my question. I’m already using nvm and .nvmrc
for years, and I read the section in the Arch wiki (I even linked it in the question.)
I use nvm (which I installed via pamac) and I have multiple versions of node on my system working.
But the nodejs
package (in pamac) is not marked installed (and I guess not installed) since I never installed it with pamac.
If another package has nodejs as a dependency. I assume it will probably be installed since it’s not there yet (or am I wrong on this?), which messes things up. At least I ran into issues like that before. I am not sure what the exact culprit was or which package caused it, but it has a hassle to fix it.
For example, the Joplin package has nodejs as a dependency, and now I have nodejs-lts-gallium installed too.
Since I am currently doing a new installation of Manjaro, I would like to install node and nvm properly to avoid issues in the future.
In the Arch wiki is something mentioned but I don’t understand what to do with it.
If you decide to use nvmAUR, previously it was suggested to use
nodejs-fake
package from AUR. Which is now deleted. Suggested way is to use--assume-installed nodejs=<version>
, as per the manual pacman(8) § TRANSACTION OPTIONS (APPLY TO -S, -R AND -U).
from ArchWiki node.js
So I guess I can break it down into 2 parts:
a) When I am using nvm, do I need to change anything in pamac, add a setting or whatnot so that pamac knows node is installed and does not install it again as dependency? Or should I install nodejs as well, even when nvm is installed?
b) A nice-to-have setup for me would be if the version of node that is used by other installed software (via pamac) uses a version of node that is kept up to date (via pamac if possible, or with nvm). For web dev I use a version of node that is needed for that project (installed with nvm and set with .nvmrc)