'How to change nodejs directory?

I have updated nodejs using yum on Centos OS, but programs still calling the old nodejs install in somewhere else. How can I change the directory for nodejs and use the updated one?

(base) user@~:$ node -v
v0.10.24

(base) user@~:$ which node
/software/node/bin/node

(base) user@~:$ /usr/bin/node -v
v10.24.1



Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source