Yarn package manager for nodejs modules (an alternative to npm) is available as yarnpkg package and yarnpkg command (this change is due to a file conflict with cmdtest package which was providing yarn command already).
# apt install yarnpkg
$ yarnpkg --version
If you want to use yarn command (for example if you want to use other tools which look for yarn command), you can add a symbolic link.
# ln -s /usr/bin/yarnpkg /usr/bin/yarn
Until bookworm, yarnpkg install yarn classic and from trixie, this will be yarn modern/berry (yarnpkg 4.x is currently in experimental).
See https://salsa.debian.org/js-team/node-yarnpkg/-/blob/master/debian/README.Debian if you want node_modules directory or want to switch back to yarn classic.
From trixie, node-corepack can be used to install yarn classic.
# apt install node-corepack
$ corepack yarn --version