{"id":11587,"date":"2025-12-08T11:29:32","date_gmt":"2025-12-08T05:59:32","guid":{"rendered":"https:\/\/www.youstable.com\/blog\/?p=11587"},"modified":"2025-12-24T16:16:50","modified_gmt":"2025-12-24T10:46:50","slug":"nstall-node-js-and-npm-windows-macos-linux","status":"publish","type":"post","link":"https:\/\/www.youstable.com\/blog\/nstall-node-js-and-npm-windows-macos-linux","title":{"rendered":"How to Install Node.js and npm on Windows, macOS &amp; Linux"},"content":{"rendered":"\n<p>Node.js has become one of the most popular JavaScript runtime environments, allowing developers to build server-side applications with ease. Along with Node.js, <strong>npm (Node Package Manager)<\/strong> is essential for managing packages and dependencies in your projects. Whether you are a beginner or an experienced developer, installing Node.js and npm correctly is the first step to start building modern applications. In this guide, you will learn how to <strong>Install Node.js and npm<\/strong> on Windows, macOS, and Linux in simple, step-by-step instructions.<\/p>\n\n\n\n<hr class=\"wp-block-separator has-alpha-channel-opacity\"\/>\n\n\n\n<h2 class=\"wp-block-heading\" class=\"wp-block-heading\" id=\"prerequisites\"><strong>Prerequisites<\/strong><\/h2>\n\n\n\n<p>Before installing Node.js and npm, ensure your system meets the following requirements:<\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li><strong>Basic system requirements:<\/strong> Modern processor and at least 1 GB RAM.<\/li>\n\n\n\n<li><strong>Administrative access:<\/strong> You should have permissions to install software on your system.<\/li>\n\n\n\n<li><strong>Internet connection:<\/strong> Required to download installers and packages.<\/li>\n<\/ul>\n\n\n\n<p>Having these ready will make the installation smooth and error-free.<\/p>\n\n\n\n<hr class=\"wp-block-separator has-alpha-channel-opacity\"\/>\n\n\n\n<h2 class=\"wp-block-heading\" class=\"wp-block-heading\" id=\"how-to-install-node-js-and-npm-on-windows\"><strong>How to Install Node.js and npm on Windows<\/strong><\/h2>\n\n\n\n<p>Installing Node.js on Windows is straightforward. The Node.js installer also includes npm, so you don\u2019t need to install it separately.<\/p>\n\n\n\n<h3 class=\"wp-block-heading\" class=\"wp-block-heading\" id=\"step-1-download-the-installer\"><strong>Step 1: Download the Installer<\/strong><\/h3>\n\n\n\n<ul class=\"wp-block-list\">\n<li>Go to the <a href=\"https:\/\/nodejs.org\/\" target=\"_blank\" rel=\"noopener\">official Node.js website<\/a>.<\/li>\n\n\n\n<li>You will see two versions: <strong>LTS (Long Term Support)<\/strong> and <strong>Current<\/strong>.\n<ul class=\"wp-block-list\">\n<li><strong>LTS<\/strong> is recommended for most users as it is stable.<\/li>\n\n\n\n<li><strong>Current<\/strong> includes the latest features.<\/li>\n<\/ul>\n<\/li>\n\n\n\n<li>Click the Windows installer to download the <code>.msi<\/code> file.<\/li>\n<\/ul>\n\n\n\n<h3 class=\"wp-block-heading\" class=\"wp-block-heading\" id=\"step-2-run-the-installer\"><strong>Step 2: Run the Installer<\/strong><\/h3>\n\n\n\n<ul class=\"wp-block-list\">\n<li>Open the downloaded file.<\/li>\n\n\n\n<li>Follow the prompts in the setup wizard:\n<ul class=\"wp-block-list\">\n<li>Accept the license agreement.<\/li>\n\n\n\n<li>Select the installation path.<\/li>\n\n\n\n<li>Keep the default options checked (including npm).<\/li>\n<\/ul>\n<\/li>\n\n\n\n<li>Click <strong>Install<\/strong> and wait for the process to complete.<\/li>\n<\/ul>\n\n\n\n<h3 class=\"wp-block-heading\" class=\"wp-block-heading\" id=\"step-3-verify-installation\"><strong>Step 3: Verify Installation<\/strong><\/h3>\n\n\n\n<ul class=\"wp-block-list\">\n<li>Open <strong>Command Prompt<\/strong>.<\/li>\n\n\n\n<li>Type the following commands: <code>node -v npm -v<\/code><\/li>\n\n\n\n<li>If both commands return version numbers, Node.js and npm are successfully installed.<\/li>\n<\/ul>\n\n\n\n<h3 class=\"wp-block-heading\" class=\"wp-block-heading\" id=\"tips-and-troubleshooting\"><strong>Tips &amp; Troubleshooting<\/strong><\/h3>\n\n\n\n<ul class=\"wp-block-list\">\n<li>If <code>node<\/code> or <code>npm<\/code> commands are not recognized, make sure the installation path is added to the system <strong>PATH<\/strong> variable.<\/li>\n\n\n\n<li>Restart your computer if the commands still don\u2019t work.<\/li>\n<\/ul>\n\n\n\n<hr class=\"wp-block-separator has-alpha-channel-opacity\"\/>\n\n\n\n<h2 class=\"wp-block-heading\" class=\"wp-block-heading\" id=\"how-to-install-node-js-and-npm-on-macos\"><strong>How to Install Node.js and npm on macOS<\/strong><\/h2>\n\n\n\n<p>On macOS, you have two main methods to install Node.js and npm: using the official installer or Homebrew.<\/p>\n\n\n\n<h3 class=\"wp-block-heading\" class=\"wp-block-heading\" id=\"method-1-using-official-installer\"><strong>Method 1: Using Official Installer<\/strong><\/h3>\n\n\n\n<ul class=\"wp-block-list\">\n<li>Visit the <a href=\"https:\/\/nodejs.org\/\" target=\"_blank\" rel=\"noopener\">Node.js website<\/a>.<\/li>\n\n\n\n<li>Download the macOS <code>.pkg<\/code> installer.<\/li>\n\n\n\n<li>Open the installer and follow the prompts.<\/li>\n\n\n\n<li>Verify installation in Terminal: <code>node -v npm -v<\/code><\/li>\n<\/ul>\n\n\n\n<h3 class=\"wp-block-heading\" class=\"wp-block-heading\" id=\"method-2-using-homebrew\"><strong>Method 2: Using Homebrew<\/strong><\/h3>\n\n\n\n<p>Homebrew is a package manager for macOS and makes installation easy.<\/p>\n\n\n\n<ol class=\"wp-block-list\">\n<li>Install Homebrew if you don\u2019t have it: <code>\/bin\/bash -c \"$(curl -fsSL https:\/\/raw.githubusercontent.com\/Homebrew\/install\/HEAD\/install.sh)\"<\/code><\/li>\n\n\n\n<li>Install Node.js and npm: <code>brew install node<\/code><\/li>\n\n\n\n<li>Verify installation: <code>node -v npm -v<\/code><\/li>\n<\/ol>\n\n\n\n<h3 class=\"wp-block-heading\" class=\"wp-block-heading\" id=\"tips-and-troubleshooting\"><strong>Tips &amp; Troubleshooting<\/strong><\/h3>\n\n\n\n<ul class=\"wp-block-list\">\n<li>If you see permission errors, use <code>sudo<\/code> for the installation command.<\/li>\n\n\n\n<li>Ensure Homebrew is updated with <code>brew update<\/code> before installing.<\/li>\n<\/ul>\n\n\n\n<hr class=\"wp-block-separator has-alpha-channel-opacity\"\/>\n\n\n\n<h2 class=\"wp-block-heading\" class=\"wp-block-heading\" id=\"how-to-install-node-js-and-npm-on-linux\"><strong>How to Install Node.js and npm on Linux<\/strong><\/h2>\n\n\n\n<p>Linux users have several options to install Node.js and npm depending on the distribution.<\/p>\n\n\n\n<h3 class=\"wp-block-heading\" class=\"wp-block-heading\" id=\"method-1-using-package-manager\"><strong>Method 1: Using Package Manager<\/strong><\/h3>\n\n\n\n<p>For Debian\/Ubuntu:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>sudo apt update\nsudo apt install nodejs npm -y<\/code><\/pre>\n\n\n\n<p><strong>For Fedora:<\/strong><\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>sudo dnf install nodejs npm -y<\/code><\/pre>\n\n\n\n<p><strong>For CentOS:<\/strong><\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>sudo yum install nodejs npm -y<\/code><\/pre>\n\n\n\n<p><strong>Verify installation:<\/strong><\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>node -v\nnpm -v<\/code><\/pre>\n\n\n\n<h3 class=\"wp-block-heading\" class=\"wp-block-heading\" id=\"method-2-using-node-version-manager-nvm\"><strong>Method 2: Using Node Version Manager (nvm)<\/strong><\/h3>\n\n\n\n<p><code>nvm<\/code> allows you to manage multiple Node.js versions easily.<\/p>\n\n\n\n<ol class=\"wp-block-list\">\n<li><strong>Install nvm:<\/strong><\/li>\n<\/ol>\n\n\n\n<pre class=\"wp-block-code\"><code>curl -o- https:\/\/raw.githubusercontent.com\/nvm-sh\/nvm\/v0.39.5\/install.sh | bash<\/code><\/pre>\n\n\n\n<ol start=\"2\" class=\"wp-block-list\">\n<li><strong>Load nvm:<\/strong><\/li>\n<\/ol>\n\n\n\n<pre class=\"wp-block-code\"><code>export NVM_DIR=\"$(&#91; -z \"${XDG_CONFIG_HOME-}\" ] &amp;&amp; printf %s \"${HOME}\/.nvm\" || printf %s \"${XDG_CONFIG_HOME}\/nvm\")\"\n&#91; -s \"$NVM_DIR\/nvm.sh\" ] &amp;&amp; \\. \"$NVM_DIR\/nvm.sh\"<\/code><\/pre>\n\n\n\n<ol start=\"3\" class=\"wp-block-list\">\n<li>Install Node.js and npm using nvm:<\/li>\n<\/ol>\n\n\n\n<pre class=\"wp-block-code\"><code>nvm install --lts\nnvm use --lts<\/code><\/pre>\n\n\n\n<ol start=\"4\" class=\"wp-block-list\">\n<li>Verify installation:<\/li>\n<\/ol>\n\n\n\n<pre class=\"wp-block-code\"><code>node -v\nnpm -v<\/code><\/pre>\n\n\n\n<h3 class=\"wp-block-heading\" class=\"wp-block-heading\" id=\"tips-and-troubleshooting\"><strong>Tips &amp; Troubleshooting<\/strong><\/h3>\n\n\n\n<ul class=\"wp-block-list\">\n<li>Using nvm is recommended if you plan to switch Node.js versions frequently.<\/li>\n\n\n\n<li>Ensure old versions of Node.js are removed if they conflict.<\/li>\n<\/ul>\n\n\n\n<hr class=\"wp-block-separator has-alpha-channel-opacity\"\/>\n\n\n\n<h2 class=\"wp-block-heading\" class=\"wp-block-heading\" id=\"updating-node-js-and-npm\"><strong>Updating Node.js and npm<\/strong><\/h2>\n\n\n\n<p>Keeping Node.js and npm updated ensures access to the latest features and security fixes.<\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li><strong>Windows &amp; macOS:<\/strong> Download the latest installer from the Node.js website and run it.<\/li>\n\n\n\n<li><strong>Linux (with package manager):<\/strong><\/li>\n<\/ul>\n\n\n\n<pre class=\"wp-block-code\"><code>sudo apt update &amp;&amp; sudo apt upgrade nodejs npm<\/code><\/pre>\n\n\n\n<ul class=\"wp-block-list\">\n<li><strong>Linux (with nvm):<\/strong><\/li>\n<\/ul>\n\n\n\n<pre class=\"wp-block-code\"><code>nvm install --lts --reinstall-packages-from=current\nnvm use --lts<\/code><\/pre>\n\n\n\n<hr class=\"wp-block-separator has-alpha-channel-opacity\"\/>\n\n\n\n<h2 class=\"wp-block-heading\" class=\"wp-block-heading\" id=\"conclusion\"><strong>Conclusion<\/strong><\/h2>\n\n\n\n<p>Installing Node.js and npm is the first essential step for any JavaScript developer. By following this guide, you can now <strong>Install Node.js and npm<\/strong> on Windows, macOS, and Linux without any issues. After installation, test your setup by running a simple Node.js script or installing a package using npm. With Node.js and npm ready, you\u2019re all set to start building fast, scalable applications.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>Node.js has become one of the most popular JavaScript runtime environments, allowing developers to build server-side applications with ease. Along [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":11859,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"_acf_changed":false,"inline_featured_image":false,"site-sidebar-layout":"default","site-content-layout":"","ast-site-content-layout":"default","site-content-style":"default","site-sidebar-style":"default","ast-global-header-display":"","ast-banner-title-visibility":"","ast-main-header-display":"","ast-hfb-above-header-display":"","ast-hfb-below-header-display":"","ast-hfb-mobile-header-display":"","site-post-title":"","ast-breadcrumbs-content":"","ast-featured-img":"","footer-sml-layout":"","ast-disable-related-posts":"","theme-transparent-header-meta":"","adv-header-id-meta":"","stick-header-meta":"","header-above-stick-meta":"","header-main-stick-meta":"","header-below-stick-meta":"","astra-migrate-meta-layouts":"default","ast-page-background-enabled":"default","ast-page-background-meta":{"desktop":{"background-color":"var(--ast-global-color-5)","background-image":"","background-repeat":"repeat","background-position":"center center","background-size":"auto","background-attachment":"scroll","background-type":"","background-media":"","overlay-type":"","overlay-color":"","overlay-opacity":"","overlay-gradient":""},"tablet":{"background-color":"","background-image":"","background-repeat":"repeat","background-position":"center center","background-size":"auto","background-attachment":"scroll","background-type":"","background-media":"","overlay-type":"","overlay-color":"","overlay-opacity":"","overlay-gradient":""},"mobile":{"background-color":"","background-image":"","background-repeat":"repeat","background-position":"center center","background-size":"auto","background-attachment":"scroll","background-type":"","background-media":"","overlay-type":"","overlay-color":"","overlay-opacity":"","overlay-gradient":""}},"ast-content-background-meta":{"desktop":{"background-color":"var(--ast-global-color-4)","background-image":"","background-repeat":"repeat","background-position":"center center","background-size":"auto","background-attachment":"scroll","background-type":"","background-media":"","overlay-type":"","overlay-color":"","overlay-opacity":"","overlay-gradient":""},"tablet":{"background-color":"var(--ast-global-color-4)","background-image":"","background-repeat":"repeat","background-position":"center center","background-size":"auto","background-attachment":"scroll","background-type":"","background-media":"","overlay-type":"","overlay-color":"","overlay-opacity":"","overlay-gradient":""},"mobile":{"background-color":"var(--ast-global-color-4)","background-image":"","background-repeat":"repeat","background-position":"center center","background-size":"auto","background-attachment":"scroll","background-type":"","background-media":"","overlay-type":"","overlay-color":"","overlay-opacity":"","overlay-gradient":""}},"footnotes":""},"categories":[350],"tags":[2103,2104],"class_list":["post-11587","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-knowledgebase","tag-install-node-js-and-npm-on-windows","tag-macos-linux"],"acf":[],"featured_image_src":"https:\/\/www.youstable.com\/blog\/wp-content\/uploads\/2025\/12\/How-to-Install-Node.js-and-npm-on-Windows-macOS-Linux.jpg","author_info":{"display_name":"YouStable","author_link":"https:\/\/www.youstable.com\/blog\/author\/youstable"},"_links":{"self":[{"href":"https:\/\/www.youstable.com\/blog\/wp-json\/wp\/v2\/posts\/11587","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.youstable.com\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.youstable.com\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.youstable.com\/blog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.youstable.com\/blog\/wp-json\/wp\/v2\/comments?post=11587"}],"version-history":[{"count":4,"href":"https:\/\/www.youstable.com\/blog\/wp-json\/wp\/v2\/posts\/11587\/revisions"}],"predecessor-version":[{"id":15740,"href":"https:\/\/www.youstable.com\/blog\/wp-json\/wp\/v2\/posts\/11587\/revisions\/15740"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/www.youstable.com\/blog\/wp-json\/wp\/v2\/media\/11859"}],"wp:attachment":[{"href":"https:\/\/www.youstable.com\/blog\/wp-json\/wp\/v2\/media?parent=11587"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.youstable.com\/blog\/wp-json\/wp\/v2\/categories?post=11587"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.youstable.com\/blog\/wp-json\/wp\/v2\/tags?post=11587"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}