NVM http://bananacore.com/ en NVM, the Node.js version manager http://bananacore.com/blog/nvm-nodejs-version-manager <span class="field field--name-title field--type-string field--label-hidden">NVM, the Node.js version manager</span> <span class="field field--name-uid field--type-entity-reference field--label-hidden"><span lang="" about="/user/17" typeof="schema:Person" property="schema:name" datatype="">Jose Daniel</span></span> <span class="field field--name-created field--type-created field--label-hidden">Thu, 05/13/2021 - 17:51</span> <div class="layout layout--onecol"> <div class="layout__region layout__region--content"> <div class="container block block-layout-builder block-field-blocknodeblogbody"> <div class="clearfix text-formatted field field--name-body field--type-text-with-summary field--label-hidden field__item"><h3>What is NVM?</h3> <p>NVM allows developers to switch between different versions of Node. This is particularly useful when an application needs to run a specific version of Node.js but the system is using a different one, here is when NVM shines.</p> <h3>NVM installation.</h3> <p>To install or update NVM, you should run the install script. To do that, you need to download the script and run it.</p> <pre> <code class="language-bash"># Using cURL curl -o- https://raw.githubusercontent.com/nvm-sh/nvm/v0.38.0/install.sh | bash # Or using Wget # wget -qO- https://raw.githubusercontent.com/nvm-sh/nvm/v0.38.0/install.sh | bash </code></pre> <p>These commands will downloads a script and runs it. Then we have load nvm.</p> <pre> <code class="language-bash">export NVM_DIR="$([ -z "${XDG_CONFIG_HOME-}" ] &amp;&amp; printf %s "${HOME}/.nvm" || printf %s "${XDG_CONFIG_HOME}/nvm")" [ -s "$NVM_DIR/nvm.sh" ] &amp;&amp; \. "$NVM_DIR/nvm.sh" # This loads nvm</code></pre> <p>In order to verify the installation, run:</p> <pre> <code class="language-bash">command -v nvm</code></pre> <p>It should output <code>nvm</code> if the installation was successful</p> <h3>How to use NVM?</h3> <p>First you need to download Node.js. This will download the latest version of Node.js</p> <pre> <code class="language-bash">nvm install node </code></pre> <p>You can also install a specific version of Node.js</p> <pre> <code class="language-bash">nvm install 6.14.4 # or 10.10.0, 8.9.1, etc </code></pre> <p>List of all available versions</p> <pre> <code class="language-bash">nvm ls-remote</code></pre> <p>List of the Node.js versions you have installed</p> <pre> <code class="language-bash">nvm ls</code></pre> <p>Use a specific version of Node.js</p> <pre> <code class="language-bash">nvm use 8.9.1</code></pre> <h3>Conclusion</h3> <p>Is incredibly easy to switch between multiple Node.js versions using NVM. If you are in a situation where the project requires a different version of Node.js or you just want to test your project with another version, Node Version Manager can help you save a lot of time.</p> <div class="alert alert-primary" role="alert"><strong>Documentation</strong><br /> - Installation: <a href="https://github.com/nvm-sh/nvm#install--update-script">https://github.com/nvm-sh/nvm#install--update-script</a></div> </div> </div> <div class="container block block-layout-builder block-field-blocknodeblogfield-tags"> <div class="field field--name-field-tags field--type-entity-reference field--label-hidden field__items"> <div class="field__item"><a href="/blog/tag/nvm" hreflang="en">NVM</a></div> <div class="field__item"><a href="/blog/tag/nodejs" hreflang="en">Node.js</a></div> </div> </div> </div> </div> Thu, 13 May 2021 23:51:42 +0000 Jose Daniel 109 at http://bananacore.com