To install Node.js on CentOS Stream 10, follow these simple steps to set up the latest Node.js version on your system.
Step 1 : Run the following command to ensure no conflicting NodeSource repositories are present:
Step 2 : Update the package repository to ensure you have the latest software versions:
Step 3 : Download the NodeSource setup script for Node.js 22.x:
Step 4 : Execute the downloaded script to add the NodeSource repository:
Step 5 : Install Node.js using the following command:
Step 6 : Confirm that Node.js is installed by checking its version:
Step 7 : Verify that npm (Node Package Manager) is installed along with Node.js by checking its version:
Congratulations! You have successfully installed Node.js and npm on CentOS Stream 10.