

Therefore the web server has been started on port 3000. Now start the web server using the command. Create a file demo_server.js vim demo_server.jsĪnd add the following content var http = require('http') Clear the metadata cache with yum clean all, so, all together. Otherwise, yum update will keep preferring the old dependency, which is incompatible with the newer packages. Let’s create a web server with the “Welcome Node.js” text. After installing the version, with curl, though, you must flush your metadata-cache when doing yum update to trigger building with the newest, available dependencies. If you want to test your node.js install. Step 4 – Create Demo Web Server (Optional) You can find more details about the current version on node.js official website. Don’t Miss => Yarn Installation ( A Node Modules Manager)Īfter installation checks the installed version of Node.js.This command will also install many other dependent packages on your system. You also need development tools to build native add-ons to be installed on your system.įor Latest Release:- sudo yum install -y gcc-c++ make curl -sL | sudo -E bash -įor Stable Release:- sudo yum install -y gcc-c++ make curl -sL | sudo -E bash - Step 2 – Install Node.js on Amazon Linux 2Īfter adding a yum repository to your system let’s install the Node.js package. Step 1 – Configure Yum Repositoryįirst of all, You need to enable the node.js yum repository in your system provided by the Node.js official website. To install the specific Node.js version, Visit our tutorial Install Specific Node.Js Version with NVM.
