<?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: Vaibhav Dwivedi</title>
    <description>The latest articles on DEV Community by Vaibhav Dwivedi (@vaibhavdn).</description>
    <link>https://dev.to/vaibhavdn</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%2F193357%2F2920c122-0ddf-4dd2-b527-757b78ae7376.jpeg</url>
      <title>DEV Community: Vaibhav Dwivedi</title>
      <link>https://dev.to/vaibhavdn</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/vaibhavdn"/>
    <language>en</language>
    <item>
      <title>Using FNM with Nushell</title>
      <dc:creator>Vaibhav Dwivedi</dc:creator>
      <pubDate>Sat, 14 May 2022 13:27:45 +0000</pubDate>
      <link>https://dev.to/vaibhavdn/using-fnm-with-nushell-3kh1</link>
      <guid>https://dev.to/vaibhavdn/using-fnm-with-nushell-3kh1</guid>
      <description>&lt;h3&gt;
  
  
  A new type of shell
&lt;/h3&gt;

&lt;p&gt;&lt;a href="https://www.nushell.sh/" rel="noopener noreferrer"&gt;Nushell&lt;/a&gt; is a cross-platform shell with a built-in powerful plugin system, but where the Nushell shines is in the way it displays the output.&lt;/p&gt;

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

&lt;p&gt;Outputs are in table format and can be filtered and sorted.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fr7el9ovho4wbzrwxsqsu.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fr7el9ovho4wbzrwxsqsu.png" alt="Output of ls command, filtered to display only the directories sorted by recently modified"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;The output of ls command, filtered to display only the directories sorted by recently modified.&lt;/p&gt;




&lt;h3&gt;
  
  
  FNM - Fast Node Manager
&lt;/h3&gt;

&lt;p&gt;&lt;a href="https://github.com/Schniz/fnm" rel="noopener noreferrer"&gt;FNM&lt;/a&gt; describes itself as a fast and simple Node.JS version manager, built in Rust.&lt;/p&gt;

&lt;h4&gt;
  
  
  Install and configure FNM
&lt;/h4&gt;

&lt;ul&gt;
&lt;li&gt;&lt;p&gt;Open the terminal and switch to Nushell.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;Install FNM using the following command.&lt;/p&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;
&lt;/code&gt;&lt;/pre&gt;
&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;curl -fsSL &lt;a href="https://fnm.vercel.app/install" rel="noopener noreferrer"&gt;https://fnm.vercel.app/install&lt;/a&gt; | bash&lt;/p&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;- Find the Nushell config by running the following command.
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;$nu.config-path&lt;/p&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;![$nu.config-path output](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/b9z8oii9qn6b20j43gtk.png)
- Open the config file in any text editor like vim and add the following lines at the end.

&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;$env.PATH = ($env.PATH | prepend "/home/vaibhavdn/.fnm")&lt;/p&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;Here we are adding the location where the FNM was installed to the PATH environment.

&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;load-env (fnm env --shell bash | lines | str replace 'export ' '' | str replace -a '"' '' | split column = | rename name value | where name != "FNM_ARCH" &amp;amp;&amp;amp; name != "PATH" | reduce -f {} {|it, acc| $acc | upsert $it.name $it.value })&lt;/p&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;Then we load the FNM_MULTISHELL_PATH

The output of the command used to load FNM_MULTISHELL_PATH
![Loading FNM multi-shell path](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/a8vcbtpbskltb2oc6sgt.png)

&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;$env.PATH = ($env.PATH | prepend $"($env.FNM_MULTISHELL_PATH)/bin")&lt;/p&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;Finally we add the loaded FNM_MULTISHELL_PATH to the PATH environment.

Save the file and restart the terminal.
FNM is ready to be used now!!

***

Edit - Nov 2023:
Updated syntax to use $env.PATH in place of let-env PATH. Thanks to @treipatru 

***

References
1. https://www.nushell.sh/book/
2. https://github.com/Schniz/fnm
3. https://github.com/Schniz/fnm/issues/463
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;

</description>
      <category>programming</category>
      <category>shell</category>
      <category>linux</category>
      <category>node</category>
    </item>
  </channel>
</rss>
