I want to update Node.js from version 18.x to 20.x on RHEL linux using dnf using this bash script.
#!/bin/bash
dnf module list
dnf module reset nodejs -y
dnf module enable nodejs:20 -y
dnf install nodejs -y
But after running that bash script, the version is still at 18.x even after restarting the session. Any command I missed from the bash script? Should I remove the nodejs first before installing the newer version? Thank you in advance.