Technoracle
    Facebook Twitter Instagram
    • Sitemap
    • Privacy Policy
    • Disclaimer
    • Term of Services
    Facebook Twitter Instagram Pinterest Vimeo
    TechnoracleTechnoracle
    • Tutorials
      • Amazon Cloud
      • Google Cloud
    • How To
    • Blog
    • About
    Subscribe
    Technoracle
    Home»Tutorials»Amazon Cloud»How to Install NodeJs on Amazon Linux Easily
    Amazon Cloud

    How to Install NodeJs on Amazon Linux Easily

    Rajesh ShivamBy Rajesh ShivamMarch 10, 2022Updated:March 10, 2022No Comments2 Mins Read
    Share Facebook Twitter Pinterest LinkedIn Tumblr Reddit Telegram Email
    how to install NodeJs on Amazon Linux
    Share
    Facebook Twitter LinkedIn Pinterest Email

    Node.js is an open-source server-side runtime environment built on Chrome’s V8 JavaScript engine. It helps to build a highly scalable server-side application using JavaScript. In this article, I am going to share how to install NodeJs on Amazon Linux.

    Page Contents

    • Installation Steps
      • Step 1: Configure Yum Repository
      • Step 2: Install NodeJs on Amazon Linux
      • Step 3: Check NodeJs Version
    • Test NodeJS Server
    • Conclusion

    Installation Steps

    Step 1: Configure Yum Repository

    To install NodeJs on Amazon Linux, first ssh into the amazon linux instance and configure the yum repository. Run the following commands to enable node.js yum repository.

    For Latest Release

    $ sudo yum install -y gcc-c++ make 
    $ curl -sL https://rpm.nodesource.com/setup_16.x | sudo -E bash - 

    For Stable Release

    $ sudo yum install -y gcc-c++ make 
    $ curl -sL https://rpm.nodesource.com/setup_16.x | sudo -E bash - 

    Step 2: Install NodeJs on Amazon Linux

    Once the node.js packages enabled, install NodeJs by running following command with NPM.

    $ sudo yum install -y nodejs 

    Step 3: Check NodeJs Version

    After installation of Node.js, check the version of node.js by following command.

    $ node --version

    Check NPM(Node Package Manager) of version

    $ npm --version

    Test NodeJS Server

    Check your node.js server by creating a server with sample text “Welcome to Node.js Server“. Let’s create a file check_server.js

    $ vi check_server.js

    Add following code snippet to the file.

    var http = require('http');
    http.createServer(function (req, res) {
      res.writeHead(200, {'Content-Type': 'text/plain'});
      res.end('Welcome to Node.js Server');
    }).listen(3000, "0.0.0.0");
    console.log('Server running at http://13.233.158.211:3000/');

    Output on the terminal on successful execution

    how to install NodeJs on Amazon Linux

    Check the server on the browser.

    http://13.233.158.211:3000/

    Output on the browser.

    how to install NodeJs on Amazon Linux

    Read More: How to Install Nodejs on EC2 Ubuntu Server [Step by Step Guide]

    Conclusion

    In this tutorial, you have learned how to install NodeJs on Amazon Linux. If you have any doubts feel free to contact me, I will definitely try to help you. Also, you can join our elite Facebook group to get direct help from me. If you like this tutorial, please share this article on your social media handle.

    amazon linux
    Share. Facebook Twitter Pinterest LinkedIn Tumblr Email
    Previous ArticleHow to SSH into EC2 Instance [Quick Steps]
    Next Article 5 Best Freelance Websites for Web Developers in 2022
    Rajesh Shivam

    Hello, everyone, I am Rajesh Shivam, I am a full-time freelancer with more than seven years plus experience in different freelancing platforms, in this blog, I am going to provide complete freelancing tips and tricks.

    Related Posts

    How To

    How to Install Microsoft Teams on Ubuntu 22.04 Easily

    February 22, 2023
    Read More
    How To

    What is Elastic IP and Its Pricing in AWS

    February 22, 2023
    Read More
    How To

    How to Convert PEM to PPK file [Step by Step Guide]

    February 22, 2023
    Read More
    Add A Comment

    Leave A Reply Cancel Reply

    Facebook Twitter Instagram Pinterest
    © 2023 Technoracle

    Type above and press Enter to search. Press Esc to cancel.

    Go to mobile version