<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:dc="http://purl.org/dc/elements/1.1/">
  <channel>
    <title>DEV Community: Ketan Jangid</title>
    <description>The latest articles on DEV Community by Ketan Jangid (@ketan2jangid).</description>
    <link>https://dev.to/ketan2jangid</link>
    <image>
      <url>https://media2.dev.to/dynamic/image/width=90,height=90,fit=cover,gravity=auto,format=auto/https:%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Fuser%2Fprofile_image%2F1173581%2Fb780bd93-8bf6-4a88-9368-c28ac5d349cf.jpeg</url>
      <title>DEV Community: Ketan Jangid</title>
      <link>https://dev.to/ketan2jangid</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/ketan2jangid"/>
    <language>en</language>
    <item>
      <title>Install NodeJS on Ubuntu 22</title>
      <dc:creator>Ketan Jangid</dc:creator>
      <pubDate>Tue, 16 Apr 2024 11:10:20 +0000</pubDate>
      <link>https://dev.to/ketan2jangid/install-nodejs-on-ubuntu-22-21e7</link>
      <guid>https://dev.to/ketan2jangid/install-nodejs-on-ubuntu-22-21e7</guid>
      <description>&lt;p&gt;NodeJS is a popular javascript runtime environment which lets you run javascript code outside a browser. In this article we'll be installing NodeJS 20 on our system which is running Ubuntu 22(jammy).&lt;/p&gt;

&lt;p&gt;If you want you can follow the instructions on official nodejs site also: &lt;a href="https://nodejs.org/en/download/package-manager/current"&gt;https://nodejs.org/en/download/package-manager/current&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;You can check our Ubuntu version using either of the following commands:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;lsb_release -a

OR

cat /etc/lsb-release
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h3&gt;
  
  
  Step 1: Update packages
&lt;/h3&gt;

&lt;p&gt;Run the following two commands to update and upgrade the packages, before we move forward&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;sudo apt update
sudo apt upgrade
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;This will ask you for the root password, enter it and let the process complete&lt;/p&gt;

&lt;h3&gt;
  
  
  Step 2: Install cURL (if not already installed)
&lt;/h3&gt;

&lt;p&gt;We'll be using the curl command to install nodejs, so if it is already present on your system you can skip this step. To check if curl is present on your system run the following command&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;curl --version
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;If you see an output like &lt;em&gt;command 'curl' not found&lt;/em&gt;, it means you need to install curl. To install curl run the following command&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;sudo apt install curl
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;After installation you can verify it by running the previous command again. If successfully installed, you will see a similar output&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/cdn-cgi/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fqpsmekyu8w0zwxiop8vp.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/cdn-cgi/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fqpsmekyu8w0zwxiop8vp.png" alt="cURL command output" width="800" height="95"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h3&gt;
  
  
  Step 3: Installing Node
&lt;/h3&gt;

&lt;p&gt;To install node run the following two commands in terminal&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;curl -o- https://raw.githubusercontent.com/nvm-sh/nvm/v0.39.7/install.sh | bash

nvm install 20
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Running the above commands installs NodeJS v20 on our system. If you want, you can install any other version of node, you'll just need to specify that version. Say you want to install v18, you'll need to run the command &lt;code&gt;nvm install 18&lt;/code&gt; instead of &lt;code&gt;nvm install 20&lt;/code&gt;&lt;/p&gt;

&lt;p&gt;If you see a message like nvm not found, close the terminal and open it again. This should fix it.&lt;/p&gt;

&lt;h3&gt;
  
  
  Step 4: Verify
&lt;/h3&gt;

&lt;p&gt;You can verify the node and npm (node package manager) version by running the following commands:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;node -v # should print v20.12.2
npm -v  # should print 10.5.0
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;I hope this article has helped you and you were able to follow along. If you are facing any trouble, comment down. &lt;/p&gt;

&lt;p&gt;Thanks. Peace.&lt;/p&gt;

</description>
      <category>ubuntu</category>
      <category>tutorial</category>
      <category>node</category>
    </item>
  </channel>
</rss>
