<?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: Gátomo</title>
    <description>The latest articles on DEV Community by Gátomo (@gatomo_oficial).</description>
    <link>https://dev.to/gatomo_oficial</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%2F649354%2F6d0269f7-c012-473e-b598-818736293e2a.jpeg</url>
      <title>DEV Community: Gátomo</title>
      <link>https://dev.to/gatomo_oficial</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/gatomo_oficial"/>
    <language>en</language>
    <item>
      <title>N, manage easily your node versions</title>
      <dc:creator>Gátomo</dc:creator>
      <pubDate>Wed, 01 Dec 2021 13:33:30 +0000</pubDate>
      <link>https://dev.to/gatomo_oficial/n-manage-easily-your-node-versions-f8k</link>
      <guid>https://dev.to/gatomo_oficial/n-manage-easily-your-node-versions-f8k</guid>
      <description>&lt;p&gt;Before share a node JS tool you should consider these things:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Your tool has no bugs&lt;/li&gt;
&lt;li&gt;Your tool has documentation&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Your tool has compatibility between versions&lt;/strong&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Compatibility is something important to keep in mind. Developers needs different versions according to their needs, so your tool must have support for different versions.&lt;/p&gt;

&lt;h2&gt;
  
  
  The problem is...
&lt;/h2&gt;

&lt;p&gt;The problem is that you need to install different versions for test it, and download and use the node installer for each version takes his time.&lt;br&gt;
Afortunately there are a lot of tools for manage versions quickly. Today I'm going to talk about &lt;strong&gt;N, a simple node version manager.&lt;/strong&gt;&lt;/p&gt;




&lt;h2&gt;
  
  
  What is N?
&lt;/h2&gt;

&lt;p&gt;N is a really simple Node version manager. It helps you to change between versions with a command.&lt;br&gt;
N supports Linux and MacOS, but not Windows, unless you use &lt;a href="https://en.m.wikipedia.org/wiki/Windows_Subsystem_for_Linux"&gt;WSL&lt;/a&gt;.&lt;/p&gt;




&lt;h2&gt;
  
  
  Here starts a short tutorial
&lt;/h2&gt;

&lt;p&gt;Ok, you know what is N and why you need it. Now let's go to install it and learn some commands.&lt;/p&gt;

&lt;h3&gt;
  
  
  Installation
&lt;/h3&gt;

&lt;p&gt;Install N globally with your favorite package manager.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--N8Ynqjef--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/wjwz87b3gbjhhad7l05y.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--N8Ynqjef--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/wjwz87b3gbjhhad7l05y.png" alt="installing N" width="588" height="558"&gt;&lt;/a&gt;&lt;br&gt;
Now you can use N CLI with &lt;code&gt;n&lt;/code&gt;&lt;/p&gt;

&lt;h3&gt;
  
  
  Install versions
&lt;/h3&gt;

&lt;p&gt;Install a version with &lt;code&gt;n &amp;lt;version&amp;gt;&lt;/code&gt;&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--7z0BWRnr--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/b3le94f14e6e6niq5p5e.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--7z0BWRnr--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/b3le94f14e6e6niq5p5e.png" alt="installing node from N" width="824" height="558"&gt;&lt;/a&gt;&lt;br&gt;
You can also put &lt;code&gt;latest&lt;/code&gt; or &lt;code&gt;current&lt;/code&gt; instead of &lt;code&gt;lts&lt;/code&gt;.&lt;br&gt;
Once the version is installed, N will save in cache the version for be available offline at any moment. Similar to Yarn with node modules 🧵&lt;/p&gt;

&lt;h3&gt;
  
  
  View installed versions
&lt;/h3&gt;

&lt;p&gt;If you installed many versions (e.g. 16.5.0 and 14.18.2) you can view a list of cached versions and select which to install.&lt;br&gt;
You should see something like this&lt;br&gt;
&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--12Wn_N69--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/lyqvfxejze2vr22y7x1c.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--12Wn_N69--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/lyqvfxejze2vr22y7x1c.png" alt="view and install" width="880" height="309"&gt;&lt;/a&gt;&lt;br&gt;
Use the arrow keys to change versions, and press enter for install.&lt;/p&gt;

&lt;h3&gt;
  
  
  Uninstall versions
&lt;/h3&gt;

&lt;p&gt;If you want to clear some specifics versions or all the cache, you can use the &lt;code&gt;rm&lt;/code&gt; and &lt;code&gt;prune&lt;/code&gt; commands, respectively.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--LmRovJKL--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/zmjykzfaemwxckqg6330.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--LmRovJKL--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/zmjykzfaemwxckqg6330.png" alt="Uninstall" width="880" height="571"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  It really works?
&lt;/h2&gt;

&lt;p&gt;Yes, it works without problems. You can do &lt;code&gt;node --version&lt;/code&gt; and check it.&lt;/p&gt;




&lt;p&gt;Congratulations 🥳! You have a useful tool for manage node versions. You can check all commands in the &lt;a href="https://www.npmjs.com/package/n"&gt;NPM page&lt;/a&gt; and view the source code in the &lt;a href="https://github.com/tj/n"&gt;GitHub repository&lt;/a&gt; 🦑&lt;/p&gt;

&lt;p&gt;Are you going to use N? You prefer other version manager? Tell me in the comments whatever you want 😄&lt;/p&gt;

</description>
      <category>javascript</category>
      <category>node</category>
      <category>tutorial</category>
      <category>productivity</category>
    </item>
  </channel>
</rss>
