Installing yarn using dnf will install several packages on my machine that i don't want.
$ sudo dnf install yarnpkg-1.22.19-5.fc37.noarch
Last metadata expiration check: 1:08:38 ago on Sat 17 Feb 2024 09:01:36 PM PST.
Dependencies resolved.
==============================================================================================================================================================
Package Architecture Version Repository Size
==============================================================================================================================================================
Installing:
yarnpkg noarch 1.22.19-5.fc37 updates 5.3 M
Installing dependencies:
nodejs x86_64 1:18.18.2-1.fc37 updates 2.2 M
nodejs-libs x86_64 1:18.18.2-1.fc37 updates 14 M
Installing weak dependencies:
nodejs-docs noarch 1:18.18.2-1.fc37 updates 7.7 M
nodejs-full-i18n x86_64 1:18.18.2-1.fc37 updates 8.5 M
nodejs-npm x86_64 1:9.8.1-1.18.18.2.1.fc37 updates 2.3 M
Transaction Summary
==============================================================================================================================================================
Install 6 Packages
Total download size: 40 M
Installed size: 203 M
Is this ok [y/N]:
For example I already have node and npm from nvm in my home directory ~/.nvm/versions/node/v16.13.0/bin/npm
You can install yarn directly via npm as described also in the official documentation
https://classic.yarnpkg.com/lang/en/docs/install