{"id":964,"date":"2024-08-19T11:56:41","date_gmt":"2024-08-19T11:56:41","guid":{"rendered":"https:\/\/zahiralam.com\/blog\/?p=964"},"modified":"2024-08-19T13:39:10","modified_gmt":"2024-08-19T13:39:10","slug":"installing-node-js-20-x-on-macos-with-apple-silicon-m1-m2-m3","status":"publish","type":"post","link":"https:\/\/zahiralam.com\/blog\/installing-node-js-20-x-on-macos-with-apple-silicon-m1-m2-m3\/","title":{"rendered":"Installing Node.js 20.x on macOS with Apple Silicon (M1, M2, M3)"},"content":{"rendered":"\n<p>Node.js 20.x offers significant improvements, and installing it on macOS, especially with Apple Silicon processors like M1, M2, or M3, ensures optimal performance. Here\u2019s how to get started.\n\n\n\n<h4 class=\"wp-block-heading\">Step 1: Install NVM (Node Version Manager)<\/h4>\n\n\n\n<p>To manage Node.js versions easily, start by installing NVM:\n\n\n\n<div class=\"code-block-container\">\n                        <pre class=\"wp-block-code\"><code id=\"code-1\">curl -o- https:\/\/raw.githubusercontent.com\/nvm-sh\/nvm\/v0.40.0\/install.sh | bash<\/code><\/pre>\n                        <amp-iframe sandbox=\"allow-scripts\" width=\"94\" height=\"72\" frameborder=\"0\" \n                                    src=\"https:\/\/zahiralam.com\/blog\/wp-content\/plugins\/amp-copy-code-button\/copier.html#curl%20-o-%20https%3A%2F%2Fraw.githubusercontent.com%2Fnvm-sh%2Fnvm%2Fv0.40.0%2Finstall.sh%20%7C%20bash\">\n                            <button class=\"copy-button\" data-label=\"curl -o- https:\/\/raw.githubusercontent.com\/nvm-sh\/nvm\/v0.40.0\/install.sh | bash\"  placeholder disabled>Copy<\/button>\n                        <\/amp-iframe>\n                    <\/div>\n\n\n\n<p>After installation, restart your terminal.\n\n\n\n<h4 class=\"wp-block-heading\">Step 2: Install Node.js<\/h4>\n\n\n\n<p>Using NVM, install Node.js 20.x:\n\n\n\n<div class=\"code-block-container\">\n                        <pre class=\"wp-block-code\"><code id=\"code-2\">nvm install 20<\/code><\/pre>\n                        <amp-iframe sandbox=\"allow-scripts\" width=\"94\" height=\"72\" frameborder=\"0\" \n                                    src=\"https:\/\/zahiralam.com\/blog\/wp-content\/plugins\/amp-copy-code-button\/copier.html#nvm%20install%2020\">\n                            <button class=\"copy-button\" data-label=\"nvm install 20\"  placeholder disabled>Copy<\/button>\n                        <\/amp-iframe>\n                    <\/div>\n\n\n\n<p>This ensures Node.js is correctly set up for your environment.\n\n\n\n<h4 class=\"wp-block-heading\">Step 3: Verify the Installation<\/h4>\n\n\n\n<p>Verify that the correct version of Node.js and npm are installed:\n\n\n\n<div class=\"code-block-container\">\n                        <pre class=\"wp-block-code\"><code id=\"code-3\">node -v\nnpm -v<\/code><\/pre>\n                        <amp-iframe sandbox=\"allow-scripts\" width=\"94\" height=\"72\" frameborder=\"0\" \n                                    src=\"https:\/\/zahiralam.com\/blog\/wp-content\/plugins\/amp-copy-code-button\/copier.html#node%20-v%0Anpm%20-v\">\n                            <button class=\"copy-button\" data-label=\"node -v\nnpm -v\"  placeholder disabled>Copy<\/button>\n                        <\/amp-iframe>\n                    <\/div>\n\n\n\n<p>You should see Node.js <code>v20.16.0<\/code> and npm <code>v10.8.1<\/code>.\n\n\n\n<h4 class=\"wp-block-heading\">Alternative: Using Homebrew<\/h4>\n\n\n\n<p>If you prefer Homebrew, ensure it\u2019s installed, then run:\n\n\n\n<div class=\"code-block-container\">\n                        <pre class=\"wp-block-code\"><code id=\"code-4\">brew install node@20<\/code><\/pre>\n                        <amp-iframe sandbox=\"allow-scripts\" width=\"94\" height=\"72\" frameborder=\"0\" \n                                    src=\"https:\/\/zahiralam.com\/blog\/wp-content\/plugins\/amp-copy-code-button\/copier.html#brew%20install%20node%4020\">\n                            <button class=\"copy-button\" data-label=\"brew install node@20\"  placeholder disabled>Copy<\/button>\n                        <\/amp-iframe>\n                    <\/div>\n\n\n\n<h4 class=\"wp-block-heading\">Additional Notes for Apple Silicon Users<\/h4>\n\n\n\n<p>macOS on Apple Silicon (M1, M2, M3) is fully supported. NVM and Homebrew seamlessly handle the architecture differences, making the installation process straightforward.\n\n\n\n<p>For those running Ubuntu, you can follow my <a href=\"https:\/\/zahiralam.com\/blog\/installing-node-js-20-x-on-ubuntu-24-04-lts-a-comprehensive-guide\/\">comprehensive guide for installing Node.js 20.x on Ubuntu 24.04 LTS<\/a>.\n\n\n\n<p>This method ensures your macOS system is ready for modern Node.js development, regardless of your processor architecture. Happy coding!\n","protected":false},"excerpt":{"rendered":"<p>Node.js 20.x offers significant improvements, and installing it on macOS, especially with Apple Silicon processors like M1, M2, or M3, ensures optimal performance. Here\u2019s how [&#8230;]<\/p>\n","protected":false},"author":1,"featured_media":970,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[214],"tags":[17,55,226],"class_list":["post-964","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-software-installation","tag-mac-m1-m2-m3","tag-nodejs","tag-nvm-node-version-manager"],"amp_enabled":true,"_links":{"self":[{"href":"https:\/\/zahiralam.com\/blog\/wp-json\/wp\/v2\/posts\/964","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/zahiralam.com\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/zahiralam.com\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/zahiralam.com\/blog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/zahiralam.com\/blog\/wp-json\/wp\/v2\/comments?post=964"}],"version-history":[{"count":2,"href":"https:\/\/zahiralam.com\/blog\/wp-json\/wp\/v2\/posts\/964\/revisions"}],"predecessor-version":[{"id":967,"href":"https:\/\/zahiralam.com\/blog\/wp-json\/wp\/v2\/posts\/964\/revisions\/967"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/zahiralam.com\/blog\/wp-json\/wp\/v2\/media\/970"}],"wp:attachment":[{"href":"https:\/\/zahiralam.com\/blog\/wp-json\/wp\/v2\/media?parent=964"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/zahiralam.com\/blog\/wp-json\/wp\/v2\/categories?post=964"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/zahiralam.com\/blog\/wp-json\/wp\/v2\/tags?post=964"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}