Starting from Fedora 24, npm is a part of Node.js package and does not need to be installed separately. Therefore, to install both npm and Node.js, you need to run:
$ sudo dnf install nodejs
You can check the available versions with:
$ dnf info nodejs $ dnf info nodejs --enablerepo rawhide
Yarn package manager is available since Fedora 29. You can install it by running:
$ sudo dnf install nodejs-yarn
Because of conflicts with other packages, yarn has to be used in the following manner:
$ nodejs-yarn add request $ yarnpkg add request
If you still wish to use
yarn instead of
nodejs-yarn, the best way is to use bash alias.
Installing Node.js modules is covered in Node.js modules.