{"id":50167,"date":"2026-02-06T08:16:32","date_gmt":"2026-02-06T08:16:32","guid":{"rendered":"https:\/\/www.carmatec.com\/?p=50167"},"modified":"2026-02-06T08:16:32","modified_gmt":"2026-02-06T08:16:32","slug":"how-to-install-nvm-on-macos-windows-and-linux","status":"publish","type":"post","link":"https:\/\/www.carmatec.com\/fi\/blog\/how-to-install-nvm-on-macos-windows-and-linux\/","title":{"rendered":"NVM:n asentaminen macOS:\u00e4\u00e4n, Windowsiin ja Linuxiin"},"content":{"rendered":"<div data-elementor-type=\"wp-post\" data-elementor-id=\"50167\" class=\"elementor elementor-50167\" data-elementor-post-type=\"post\">\n\t\t\t\t<div class=\"elementor-element elementor-element-01f1794 e-flex e-con-boxed e-con e-parent\" data-id=\"01f1794\" data-element_type=\"container\" data-e-type=\"container\">\n\t\t\t\t\t<div class=\"e-con-inner\">\n\t\t\t\t<div class=\"elementor-element elementor-element-6c4e46e elementor-widget elementor-widget-text-editor\" data-id=\"6c4e46e\" data-element_type=\"widget\" data-e-type=\"widget\" data-widget_type=\"text-editor.default\">\n\t\t\t\t\t\t\t\t\t<p><span style=\"font-weight: 400;\">Node Version Manager (NVM) is an essential tool for developers working with Node.js. It allows you to install, manage, and switch between multiple <\/span><a href=\"https:\/\/nodejs.org\/en\"><span style=\"font-weight: 400;\">Node.js<\/span><\/a><span style=\"font-weight: 400;\"> versions seamlessly across different projects. Whether you\u2019re a beginner setting up your first development environment or an experienced developer handling multiple Node.js applications, NVM simplifies version control and boosts productivity.<\/span><\/p><p><span style=\"font-weight: 400;\">In this guide, you\u2019ll learn <\/span><b>how to install NVM on macOS, Windows, and Linux<\/b><span style=\"font-weight: 400;\">, along with usage tips, troubleshooting advice, and best practices.<\/span><\/p><p><b>Introduction to NVM (Node Version Manager)<\/b><\/p><p><span style=\"font-weight: 400;\">NVM manages <\/span><b>Node.js<\/b><span style=\"font-weight: 400;\"> versions per user in isolated directories. It supports project-specific versions via <\/span><span style=\"font-weight: 400;\"><code>.nvmrc<\/code><\/span><span style=\"font-weight: 400;\"> files and keeps global npm packages separate per Node version.<\/span><\/p><p><b>Why Use NVM (Node Version Manager) in 2026<\/b><\/p><p><b>Node.js<\/b><span style=\"font-weight: 400;\"> follows a predictable release schedule:<\/span><\/p><ul><li style=\"font-weight: 400;\" aria-level=\"1\"><span style=\"font-weight: 400;\">Even-numbered versions become <\/span><b>LTS<\/b><span style=\"font-weight: 400;\"> (Long-Term Support).<\/span><\/li><li style=\"font-weight: 400;\" aria-level=\"1\"><span style=\"font-weight: 400;\">Current <\/span><b>LTS<\/b><span style=\"font-weight: 400;\"> versions (February 2026):<\/span><ul><li style=\"font-weight: 400;\" aria-level=\"2\"><b>Node 24<\/b><span style=\"font-weight: 400;\"> (Krypton) \u2014 Active LTS (entered May 2025; supported until ~April 2028).<\/span><\/li><li style=\"font-weight: 400;\" aria-level=\"2\"><b>Node 22<\/b><span style=\"font-weight: 400;\"> (Jod) \u2014 Maintenance LTS (until April 2026).<\/span><\/li><li style=\"font-weight: 400;\" aria-level=\"2\"><b>Node 20<\/b><span style=\"font-weight: 400;\"> (Iron) \u2014 Maintenance LTS (until April 2026).<\/span><\/li><\/ul><\/li><li style=\"font-weight: 400;\" aria-level=\"1\"><b>Node 25<\/b><span style=\"font-weight: 400;\"> \u2014 Current (non-LTS; latest features as of January 2026).<\/span><\/li><\/ul><p><span style=\"font-weight: 400;\">NVM helps maintain legacy projects, test new features, and ensure team consistency.<\/span><\/p><h4><b>NVM Implementations Overview<\/b><\/h4><table><tbody><tr><td><b>Alusta<\/b><\/td><td><b>Tool Name<\/b><\/td><td><b>Repository Link<\/b><\/td><td><b>Latest Version (Feb 2026)<\/b><\/td><td><b>Installation Type<\/b><\/td><\/tr><tr><td><span style=\"font-weight: 400;\">macOS \/ Linux \/ WSL<\/span><\/td><td><span style=\"font-weight: 400;\">nvm-sh\/nvm<\/span><\/td><td><span style=\"font-weight: 400;\">github.com\/nvm-sh\/nvm<\/span><\/td><td><span style=\"font-weight: 400;\">v0.40.4 (Jan 29, 2026)<\/span><\/td><td><span style=\"font-weight: 400;\">Shell script<\/span><\/td><\/tr><tr><td><span style=\"font-weight: 400;\">Native Windows<\/span><\/td><td><span style=\"font-weight: 400;\">nvm-windows<\/span><\/td><td><span style=\"font-weight: 400;\">github.com\/coreybutler\/nvm-windows<\/span><\/td><td><span style=\"font-weight: 400;\">1.2.2 (Dec 31, 2024)<\/span><\/td><td><span style=\"font-weight: 400;\">.exe installer<\/span><\/td><\/tr><\/tbody><\/table><p><span style=\"font-weight: 400;\">Use nvm-sh\/nvm inside <\/span><b>WSL<\/b><span style=\"font-weight: 400;\"> on Windows for Unix-like behavior.<\/span><\/p><h3><b>Prerequisites Before Installing NVM<\/b><\/h3><p><span style=\"font-weight: 400;\">Before installing NVM, ensure you have:<\/span><\/p><ul><li style=\"font-weight: 400;\" aria-level=\"1\"><span style=\"font-weight: 400;\">A terminal or command prompt<\/span><span style=\"font-weight: 400;\"><br \/><\/span><\/li><li style=\"font-weight: 400;\" aria-level=\"1\"><span style=\"font-weight: 400;\">Basic command-line knowledge<\/span><span style=\"font-weight: 400;\"><br \/><\/span><\/li><li style=\"font-weight: 400;\" aria-level=\"1\"><span style=\"font-weight: 400;\">Administrator or sudo access (for macOS and Linux)<\/span><span style=\"font-weight: 400;\"><br \/><\/span><\/li><li style=\"font-weight: 400;\" aria-level=\"1\"><span style=\"font-weight: 400;\">PowerShell or Command Prompt access (for Windows)<\/span><\/li><\/ul><p><span style=\"font-weight: 400;\">No existing Node.js installation is required, but NVM can coexist with it if needed.<\/span><\/p><h3><b>How to Install NVM on macOS<\/b><\/h3><p><span style=\"font-weight: 400;\">macOS users can install NVM using either <\/span><b>curl<\/b><span style=\"font-weight: 400;\"> tai <\/span><b>wget<\/b><span style=\"font-weight: 400;\">.<\/span><\/p><h4><b>Step 1: Open Terminal<\/b><\/h4><p><span style=\"font-weight: 400;\">You can open Terminal from <\/span><b>Applications \u2192 Utilities \u2192 Terminal<\/b><span style=\"font-weight: 400;\"> or by using Spotlight Search.<\/span><\/p><h4><b>Step 2: Install NVM Using curl<\/b><\/h4><p><span style=\"font-weight: 400;\">Run the following command:<\/span><\/p><pre><span style=\"font-weight: 400;\">curl -o-\nhttps:\/\/raw.githubusercontent.com\/nvm-sh\/nvm\/v0.39.7\/install.sh | bash<\/span><\/pre><p><span style=\"font-weight: 400;\">Alternatively, using wget:<\/span><\/p><pre><span style=\"font-weight: 400;\">wget -qO-\nhttps:\/\/raw.githubusercontent.com\/nvm-sh\/nvm\/v0.39.7\/install.sh | bash<\/span><\/pre><h4><b>Step 3: Load NVM<\/b><\/h4><p><span style=\"font-weight: 400;\">After installation, restart the terminal or run:<\/span><\/p><h4><b>Step 4: Verify Installation<\/b><\/h4><pre><span style=\"font-weight: 400;\">nvm --version<\/span><\/pre><p><span style=\"font-weight: 400;\">If a version number appears, NVM is installed successfully on macOS.<\/span><\/p><h3><b>How to Install NVM on Linux<\/b><\/h3><p><span style=\"font-weight: 400;\">Installing NVM on Linux is similar to macOS and supports most distributions including Ubuntu, Debian, Fedora, and CentOS.<\/span><\/p><h4><b>Step 1: Open Terminal<\/b><\/h4><p><span style=\"font-weight: 400;\">Use your default terminal application.<\/span><\/p><h4><b>Step 2: Install NVM<\/b><\/h4><p><span style=\"font-weight: 400;\">Run the following command:<\/span><\/p><pre><span style=\"font-weight: 400;\">curl -o-\nhttps:\/\/raw.githubusercontent.com\/nvm-sh\/nvm\/v0.39.7\/install.sh | bash<\/span><\/pre><h4><b>Step 3: Update Shell Configuration<\/b><\/h4><p><span style=\"font-weight: 400;\">Reload your shell configuration:<\/span><\/p><h4><b>Step 4: Confirm Installation<\/b><\/h4><pre><span style=\"font-weight: 400;\">nvm --version<\/span><\/pre><p><span style=\"font-weight: 400;\">NVM should now be available on your Linux system.<\/span><\/p><h3><b>How to Install NVM on Windows<\/b><\/h3><p><span style=\"font-weight: 400;\">Windows uses a separate implementation called <\/span><b>nvm-windows<\/b><span style=\"font-weight: 400;\">, which provides similar functionality.<\/span><\/p><h4><b>Step 1: Download NVM for Windows<\/b><\/h4><p><span style=\"font-weight: 400;\">Visit the official GitHub repository for nvm-windows and download the latest installer.<\/span><\/p><h4><b>Step 2: Run the Installer<\/b><\/h4><ul><li style=\"font-weight: 400;\" aria-level=\"1\"><span style=\"font-weight: 400;\">Launch the <\/span><span style=\"font-weight: 400;\"><code>.exe<\/code><\/span><span style=\"font-weight: 400;\"> file<\/span><span style=\"font-weight: 400;\"><br \/><\/span><\/li><li style=\"font-weight: 400;\" aria-level=\"1\"><span style=\"font-weight: 400;\">Follow the setup wizard<\/span><span style=\"font-weight: 400;\"><br \/><\/span><\/li><li style=\"font-weight: 400;\" aria-level=\"1\"><span style=\"font-weight: 400;\">Choose installation and Node.js directories<\/span><\/li><\/ul><h4><b>Step 3: Restart Command Prompt or PowerShell<\/b><\/h4><p><span style=\"font-weight: 400;\">After installation, restart your terminal.<\/span><\/p><h4><b>Step 4: Verify Installation<\/b><\/h4><pre><span style=\"font-weight: 400;\">nvm version<\/span><\/pre><p><span style=\"font-weight: 400;\">You should see the installed NVM version displayed.<\/span><\/p><h3><b>Installing Node.js Using NVM<\/b><\/h3><p><span style=\"font-weight: 400;\">Once NVM is installed, installing Node.js is straightforward.<\/span><\/p><h4><b>Install the Latest Node.js Version<\/b><\/h4><p><span style=\"font-weight: 400;\"><code>nvm install node<\/code><\/span><\/p><h4><b>Install a Specific Node.js Version<\/b><\/h4><p><span style=\"font-weight: 400;\"><code>nvm install 18.20.0<\/code><\/span><\/p><h4><b>List Installed Versions<\/b><\/h4><p><span style=\"font-weight: 400;\"><code>nvm ls<\/code><\/span><\/p><h4><b>Switch Node.js Versions<\/b><\/h4><p><span style=\"font-weight: 400;\"><code>nvm use 18.20.0<\/code><\/span><\/p><p><span style=\"font-weight: 400;\">NVM automatically updates npm for each Node.js version.<\/span><\/p><h3><b>Setting a Default Node.js Version<\/b><\/h3><p><span style=\"font-weight: 400;\">To set a default Node.js version:<\/span><\/p><p><span style=\"font-weight: 400;\"><code>nvm alias default 18.20.0<\/code><\/span><\/p><p><span style=\"font-weight: 400;\">This ensures the selected version is used whenever a new terminal session starts.<\/span><\/p><h3><b>Using NVM Per Project<\/b><\/h3><p><span style=\"font-weight: 400;\">You can create a <\/span><span style=\"font-weight: 400;\"><code>.nvmrc<\/code><\/span><span style=\"font-weight: 400;\"> file inside your project directory:<\/span><\/p><pre><span style=\"font-weight: 400;\">echo 18.20.0 &gt; .nvmrc\n<\/span><\/pre><p><span style=\"font-weight: 400;\">Then run:<\/span><\/p><p><span style=\"font-weight: 400;\"><code>nvm use<\/code><\/span><\/p><p><span style=\"font-weight: 400;\">This ensures consistency across teams and environments.<\/span><\/p><h3><b>Common NVM Commands Cheat Sheet<\/b><\/h3><table><tbody><tr><td><b>Komento<\/b><\/td><td><b>Kuvaus<\/b><\/td><\/tr><tr><td><span style=\"font-weight: 400;\">nvm install node<\/span><\/td><td><span style=\"font-weight: 400;\">Install latest Node.js<\/span><\/td><\/tr><tr><td><span style=\"font-weight: 400;\">nvm install &lt;version&gt;<\/span><\/td><td><span style=\"font-weight: 400;\">Install specific Node.js version<\/span><\/td><\/tr><tr><td><span style=\"font-weight: 400;\">nvm use &lt;version&gt;<\/span><\/td><td><span style=\"font-weight: 400;\">Switch Node.js version<\/span><\/td><\/tr><tr><td><span style=\"font-weight: 400;\">nvm ls<\/span><\/td><td><span style=\"font-weight: 400;\">List installed versions<\/span><\/td><\/tr><tr><td><span style=\"font-weight: 400;\">nvm ls-remote<\/span><\/td><td><span style=\"font-weight: 400;\">List available Node.js versions<\/span><\/td><\/tr><tr><td><span style=\"font-weight: 400;\">nvm uninstall &lt;version&gt;<\/span><\/td><td><span style=\"font-weight: 400;\">Remove Node.js version<\/span><\/td><\/tr><\/tbody><\/table><h3><b>Troubleshooting Common NVM Issues<\/b><\/h3><h4><b>NVM Command Not Found<\/b><\/h4><ul><li style=\"font-weight: 400;\" aria-level=\"1\"><span style=\"font-weight: 400;\">Ensure your shell configuration file is sourced<\/span><\/li><li aria-level=\"1\"><span style=\"font-weight: 400;\">Restart the terminal<\/span><\/li><\/ul><h4><b>Lupavirheet<\/b><\/h4><ul><li><span style=\"font-weight: 400;\">Avoid using <\/span><span style=\"font-weight: 400;\"><code>sudo<\/code><\/span><span style=\"font-weight: 400;\"> with NVM<\/span><span style=\"font-weight: 400;\"><br \/><\/span><\/li><li><span style=\"font-weight: 400;\">Ensure proper directory ownership<\/span><\/li><\/ul><h4><b>Windows Path Issues<\/b><\/h4><ul><li style=\"font-weight: 400;\" aria-level=\"1\"><span style=\"font-weight: 400;\">Ensure no conflicting Node.js installations exist<\/span><\/li><li style=\"font-weight: 400;\" aria-level=\"1\"><span style=\"font-weight: 400;\">Reboot system if needed<\/span><\/li><\/ul><h3><b>Best Practices When Using NVM<\/b><\/h3><ul><li style=\"font-weight: 400;\" aria-level=\"1\"><span style=\"font-weight: 400;\">K\u00e4yt\u00e4 <\/span><span style=\"font-weight: 400;\"><code>.nvmrc<\/code><\/span><span style=\"font-weight: 400;\"> files for team consistency<\/span><\/li><li style=\"font-weight: 400;\" aria-level=\"1\"><span style=\"font-weight: 400;\">Avoid global npm packages when possible<\/span><\/li><li style=\"font-weight: 400;\" aria-level=\"1\"><span style=\"font-weight: 400;\">Keep Node.js LTS versions for production<\/span><\/li><li style=\"font-weight: 400;\" aria-level=\"1\"><span style=\"font-weight: 400;\">Regularly update NVM<\/span><\/li><li style=\"font-weight: 400;\" aria-level=\"1\"><span style=\"font-weight: 400;\">Test applications across multiple Node versions<\/span><\/li><\/ul><h3><b>Is NVM Suitable for Production Environments?<\/b><\/h3><p><span style=\"font-weight: 400;\">NVM is primarily designed for development environments. In production, containerization tools like Docker or managed Node.js environments are typically preferred. However, NVM remains invaluable for local development, testing, and CI pipelines.<\/span><\/p><h2><b>Johtop\u00e4\u00e4t\u00f6s<\/b><\/h2><p><span style=\"font-weight: 400;\">Installing NVM on macOS, Windows, and Linux is a critical step for modern Node.js development. It provides flexibility, eliminates version conflicts, and streamlines project workflows. By mastering NVM, developers can focus more on building robust applications rather than managing environments.<\/span><\/p><p><span style=\"font-weight: 400;\">For businesses looking to build scalable, high-performance Node.js applications, <\/span><a href=\"https:\/\/www.carmatec.com\/fi\/\"><b>Carmatec<\/b><\/a><span style=\"font-weight: 400;\"> stands out as a trusted <\/span><a href=\"https:\/\/www.carmatec.com\/fi\/node-js-kehitysyhtio\/\"><b>Node.js development company<\/b><\/a><span style=\"font-weight: 400;\">. With deep expertise in enterprise-grade solutions, Carmatec helps organizations design, develop, and maintain powerful Node.js applications. Whether you want to modernize an existing system or <\/span><a href=\"https:\/\/www.carmatec.com\/fi\/palkata-kehittajia\/palkata-nodejs-kehittaja\/\"><b>hire Node.js developers<\/b><\/a><span style=\"font-weight: 400;\"> for a new project, Carmatec delivers reliable, secure, and future-ready solutions.<\/span><\/p>\t\t\t\t\t\t\t\t<\/div>\n\t\t\t\t\t<\/div>\n\t\t\t\t<\/div>\n\t\t\t\t<\/div>","protected":false},"excerpt":{"rendered":"<p>Node Version Manager (NVM) is an essential tool for developers working with Node.js. It allows you to install, manage, and switch between multiple Node.js versions seamlessly across different projects. Whether you\u2019re a beginner setting up your first development environment or an experienced developer handling multiple Node.js applications, NVM simplifies version control and boosts productivity. In [&hellip;]<\/p>\n","protected":false},"author":10,"featured_media":50390,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[4],"tags":[],"class_list":["post-50167","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-blog"],"_links":{"self":[{"href":"https:\/\/www.carmatec.com\/fi\/wp-json\/wp\/v2\/posts\/50167","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.carmatec.com\/fi\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.carmatec.com\/fi\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.carmatec.com\/fi\/wp-json\/wp\/v2\/users\/10"}],"replies":[{"embeddable":true,"href":"https:\/\/www.carmatec.com\/fi\/wp-json\/wp\/v2\/comments?post=50167"}],"version-history":[{"count":104,"href":"https:\/\/www.carmatec.com\/fi\/wp-json\/wp\/v2\/posts\/50167\/revisions"}],"predecessor-version":[{"id":50391,"href":"https:\/\/www.carmatec.com\/fi\/wp-json\/wp\/v2\/posts\/50167\/revisions\/50391"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/www.carmatec.com\/fi\/wp-json\/wp\/v2\/media\/50390"}],"wp:attachment":[{"href":"https:\/\/www.carmatec.com\/fi\/wp-json\/wp\/v2\/media?parent=50167"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.carmatec.com\/fi\/wp-json\/wp\/v2\/categories?post=50167"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.carmatec.com\/fi\/wp-json\/wp\/v2\/tags?post=50167"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}