{"id":184,"date":"2021-03-02T20:10:05","date_gmt":"2021-03-02T20:10:05","guid":{"rendered":"https:\/\/andrejacobs.org\/?p=184"},"modified":"2022-04-11T20:24:24","modified_gmt":"2022-04-11T20:24:24","slug":"installing-node-js-on-macos-big-sur-using-nvm","status":"publish","type":"post","link":"https:\/\/andrejacobs.org\/macos\/installing-node-js-on-macos-big-sur-using-nvm\/","title":{"rendered":"Installing Node.js on macOS Big Sur using nvm"},"content":{"rendered":"\n

Photo by Lukas Hellebrand<\/a> on Unsplash<\/a><\/p>\n\n\n\n

I recently clean installed macOS Big Sur and is in the process of setting up all my software. As part of the spring cleaning process I wanted to clear out all of the GitHub forks that I accumulated like a snowball.<\/p>\n\n\n\n

To help in this process I found delete-github-forks<\/a> that can bulk delete GitHub forks and this tool is written using Node.js<\/p>\n\n\n\n

So I thought it would be a good idea to document how I install node on macOS Big Sur.<\/p>\n\n\n\n

Installing nvm<\/h2>\n\n\n\n

nvm<\/code> (node version manager)<\/a> allows you to have multiple versions of node installed and thus help avoid compatibility issues when projects use different versions of node.<\/p>\n\n\n\n

Get the latest command line script to be run from https:\/\/github.com\/nvm-sh\/nvm<\/a> and then run the command in the terminal. It is always a good idea to first read the script before just blindly running it.<\/p>\n\n\n\n

The script will make changes to .zshrc<\/code> so I backup mine first and then install nvm<\/code>.<\/p>\n\n\n\n

Note:<\/strong> If you don’t have a .zshrc<\/code> file yet then you need to create it first (touch ~\/.zshrc<\/code>)<\/p>\n\n\n\n

$ cp .zshrc .zshrc.bak\n$ curl -o- https:\/\/raw.githubusercontent.com\/nvm-sh\/nvm\/v0.37.2\/install.sh | bash<\/code><\/pre>\n\n\n\n

Then I verify the changes made to .zshrc<\/code><\/p>\n\n\n\n

$ diff .zshrc .zshrc.bak\n40,43d39\n<\n< export NVM_DIR=\"$HOME\/.nvm\"\n< [ -s \"$NVM_DIR\/nvm.sh\" ] && \\. \"$NVM_DIR\/nvm.sh\"  # This loads nvm\n< [ -s \"$NVM_DIR\/bash_completion\" ] && \\. \"$NVM_DIR\/bash_completion\"  # This loads nvm bash_completion<\/code><\/pre>\n\n\n\n

Relaunch the terminal and verify nvm<\/code><\/p>\n\n\n\n

$ nvm -v\n0.37.2<\/code><\/pre>\n\n\n\n

Installing node<\/h2>\n\n\n\n

To install the latest version of node.<\/p>\n\n\n\n

$ nvm install node<\/code><\/pre>\n\n\n\n
\"\"<\/figure><\/div>\n\n\n\n

Verify the version of node being used.<\/p>\n\n\n\n

$ nvm run node --version\nRunning node v15.10.0 (npm v7.5.3)\nv15.10.0\n\nYou can also now just use node directly\n$ node --version\nv15.10.0<\/code><\/pre>\n\n\n\n

To install a different version of node.<\/p>\n\n\n\n

$ nvm install 14.16.0\n$ nvm use 14.16.0<\/code><\/pre>\n\n\n\n

List the installed versions.<\/p>\n\n\n\n

$ nvm ls<\/code><\/pre>\n\n\n\n

See https:\/\/github.com\/nvm-sh\/nvm<\/a> for more information on how to use nvm<\/code>.<\/p>\n","protected":false},"excerpt":{"rendered":"

Photo by Lukas Hellebrand on Unsplash I recently clean installed macOS Big Sur and is in the process of setting up all my software. As part of the spring cleaning process I wanted to clear out all of the GitHub forks that I accumulated like a snowball. To help in this process I found delete-github-forks […]<\/p>\n

Read more →<\/a><\/p>\n","protected":false},"author":2,"featured_media":195,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"_mi_skip_tracking":false,"_monsterinsights_sitenote_active":false,"_monsterinsights_sitenote_note":"","_monsterinsights_sitenote_category":0,"footnotes":""},"categories":[4],"tags":[34],"yoast_head":"\nInstalling Node.js on macOS Big Sur using nvm - Andr\u00e9 Jacobs<\/title>\n<meta name=\"description\" content=\"In this post I will show you how to install the latest Node.js on macOS Big Sur using node version manager.\" \/>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/andrejacobs.org\/macos\/installing-node-js-on-macos-big-sur-using-nvm\/\" \/>\n<meta property=\"og:locale\" content=\"en_GB\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"Installing Node.js on macOS Big Sur using nvm - Andr\u00e9 Jacobs\" \/>\n<meta property=\"og:description\" content=\"In this post I will show you how to install the latest Node.js on macOS Big Sur using node version manager.\" \/>\n<meta property=\"og:url\" content=\"https:\/\/andrejacobs.org\/macos\/installing-node-js-on-macos-big-sur-using-nvm\/\" \/>\n<meta property=\"og:site_name\" content=\"Andr\u00e9 Jacobs\" \/>\n<meta property=\"article:published_time\" content=\"2021-03-02T20:10:05+00:00\" \/>\n<meta property=\"article:modified_time\" content=\"2022-04-11T20:24:24+00:00\" \/>\n<meta property=\"og:image\" content=\"https:\/\/andrejacobs.org\/wp-content\/uploads\/2021\/03\/lukas-hellebrand-E1S962T0g5c-unsplash.jpg\" \/>\n\t<meta property=\"og:image:width\" content=\"1920\" \/>\n\t<meta property=\"og:image:height\" content=\"1280\" \/>\n\t<meta property=\"og:image:type\" content=\"image\/jpeg\" \/>\n<meta name=\"author\" content=\"Andr\u00e9 Jacobs\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:creator\" content=\"@andrejacobs81\" \/>\n<meta name=\"twitter:site\" content=\"@andrejacobs81\" \/>\n<meta name=\"twitter:label1\" content=\"Written by\" \/>\n\t<meta name=\"twitter:data1\" content=\"Andr\u00e9 Jacobs\" \/>\n\t<meta name=\"twitter:label2\" content=\"Estimated reading time\" \/>\n\t<meta name=\"twitter:data2\" content=\"2 minutes\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\/\/schema.org\",\"@graph\":[{\"@type\":\"Article\",\"@id\":\"https:\/\/andrejacobs.org\/macos\/installing-node-js-on-macos-big-sur-using-nvm\/#article\",\"isPartOf\":{\"@id\":\"https:\/\/andrejacobs.org\/macos\/installing-node-js-on-macos-big-sur-using-nvm\/\"},\"author\":{\"name\":\"Andr\u00e9 Jacobs\",\"@id\":\"https:\/\/andrejacobs.org\/#\/schema\/person\/3d38360883015e883c80c2fb875c5a68\"},\"headline\":\"Installing Node.js on macOS Big Sur using nvm\",\"datePublished\":\"2021-03-02T20:10:05+00:00\",\"dateModified\":\"2022-04-11T20:24:24+00:00\",\"mainEntityOfPage\":{\"@id\":\"https:\/\/andrejacobs.org\/macos\/installing-node-js-on-macos-big-sur-using-nvm\/\"},\"wordCount\":245,\"publisher\":{\"@id\":\"https:\/\/andrejacobs.org\/#\/schema\/person\/3d38360883015e883c80c2fb875c5a68\"},\"keywords\":[\"node.js\"],\"articleSection\":[\"macOS\"],\"inLanguage\":\"en-GB\"},{\"@type\":\"WebPage\",\"@id\":\"https:\/\/andrejacobs.org\/macos\/installing-node-js-on-macos-big-sur-using-nvm\/\",\"url\":\"https:\/\/andrejacobs.org\/macos\/installing-node-js-on-macos-big-sur-using-nvm\/\",\"name\":\"Installing Node.js on macOS Big Sur using nvm - Andr\u00e9 Jacobs\",\"isPartOf\":{\"@id\":\"https:\/\/andrejacobs.org\/#website\"},\"datePublished\":\"2021-03-02T20:10:05+00:00\",\"dateModified\":\"2022-04-11T20:24:24+00:00\",\"description\":\"In this post I will show you how to install the latest Node.js on macOS Big Sur using node version manager.\",\"breadcrumb\":{\"@id\":\"https:\/\/andrejacobs.org\/macos\/installing-node-js-on-macos-big-sur-using-nvm\/#breadcrumb\"},\"inLanguage\":\"en-GB\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\/\/andrejacobs.org\/macos\/installing-node-js-on-macos-big-sur-using-nvm\/\"]}]},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\/\/andrejacobs.org\/macos\/installing-node-js-on-macos-big-sur-using-nvm\/#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Home\",\"item\":\"https:\/\/andrejacobs.org\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"Installing Node.js on macOS Big Sur using nvm\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\/\/andrejacobs.org\/#website\",\"url\":\"https:\/\/andrejacobs.org\/\",\"name\":\"Andr\u00e9 Jacobs\",\"description\":\"iOS Development, Electronics, Robotics, Artificial Intelligence, Business and Health\",\"publisher\":{\"@id\":\"https:\/\/andrejacobs.org\/#\/schema\/person\/3d38360883015e883c80c2fb875c5a68\"},\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\/\/andrejacobs.org\/?s={search_term_string}\"},\"query-input\":\"required name=search_term_string\"}],\"inLanguage\":\"en-GB\"},{\"@type\":[\"Person\",\"Organization\"],\"@id\":\"https:\/\/andrejacobs.org\/#\/schema\/person\/3d38360883015e883c80c2fb875c5a68\",\"name\":\"Andr\u00e9 Jacobs\",\"image\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-GB\",\"@id\":\"https:\/\/andrejacobs.org\/#\/schema\/person\/image\/\",\"url\":\"https:\/\/andrejacobs.org\/wp-content\/uploads\/2019\/03\/andre_jacobs.jpg\",\"contentUrl\":\"https:\/\/andrejacobs.org\/wp-content\/uploads\/2019\/03\/andre_jacobs.jpg\",\"width\":450,\"height\":450,\"caption\":\"Andr\u00e9 Jacobs\"},\"logo\":{\"@id\":\"https:\/\/andrejacobs.org\/#\/schema\/person\/image\/\"},\"sameAs\":[\"https:\/\/andrejacobs.org\",\"https:\/\/www.youtube.com\/channel\/UCzqXvnd_UJ3sAzQkQBD-IVw\"],\"url\":\"https:\/\/andrejacobs.org\/author\/andre\/\"}]}<\/script>\n<!-- \/ Yoast SEO plugin. -->","yoast_head_json":{"title":"Installing Node.js on macOS Big Sur using nvm - Andr\u00e9 Jacobs","description":"In this post I will show you how to install the latest Node.js on macOS Big Sur using node version manager.","robots":{"index":"index","follow":"follow","max-snippet":"max-snippet:-1","max-image-preview":"max-image-preview:large","max-video-preview":"max-video-preview:-1"},"canonical":"https:\/\/andrejacobs.org\/macos\/installing-node-js-on-macos-big-sur-using-nvm\/","og_locale":"en_GB","og_type":"article","og_title":"Installing Node.js on macOS Big Sur using nvm - Andr\u00e9 Jacobs","og_description":"In this post I will show you how to install the latest Node.js on macOS Big Sur using node version manager.","og_url":"https:\/\/andrejacobs.org\/macos\/installing-node-js-on-macos-big-sur-using-nvm\/","og_site_name":"Andr\u00e9 Jacobs","article_published_time":"2021-03-02T20:10:05+00:00","article_modified_time":"2022-04-11T20:24:24+00:00","og_image":[{"width":1920,"height":1280,"url":"https:\/\/andrejacobs.org\/wp-content\/uploads\/2021\/03\/lukas-hellebrand-E1S962T0g5c-unsplash.jpg","type":"image\/jpeg"}],"author":"Andr\u00e9 Jacobs","twitter_card":"summary_large_image","twitter_creator":"@andrejacobs81","twitter_site":"@andrejacobs81","twitter_misc":{"Written by":"Andr\u00e9 Jacobs","Estimated reading time":"2 minutes"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"Article","@id":"https:\/\/andrejacobs.org\/macos\/installing-node-js-on-macos-big-sur-using-nvm\/#article","isPartOf":{"@id":"https:\/\/andrejacobs.org\/macos\/installing-node-js-on-macos-big-sur-using-nvm\/"},"author":{"name":"Andr\u00e9 Jacobs","@id":"https:\/\/andrejacobs.org\/#\/schema\/person\/3d38360883015e883c80c2fb875c5a68"},"headline":"Installing Node.js on macOS Big Sur using nvm","datePublished":"2021-03-02T20:10:05+00:00","dateModified":"2022-04-11T20:24:24+00:00","mainEntityOfPage":{"@id":"https:\/\/andrejacobs.org\/macos\/installing-node-js-on-macos-big-sur-using-nvm\/"},"wordCount":245,"publisher":{"@id":"https:\/\/andrejacobs.org\/#\/schema\/person\/3d38360883015e883c80c2fb875c5a68"},"keywords":["node.js"],"articleSection":["macOS"],"inLanguage":"en-GB"},{"@type":"WebPage","@id":"https:\/\/andrejacobs.org\/macos\/installing-node-js-on-macos-big-sur-using-nvm\/","url":"https:\/\/andrejacobs.org\/macos\/installing-node-js-on-macos-big-sur-using-nvm\/","name":"Installing Node.js on macOS Big Sur using nvm - Andr\u00e9 Jacobs","isPartOf":{"@id":"https:\/\/andrejacobs.org\/#website"},"datePublished":"2021-03-02T20:10:05+00:00","dateModified":"2022-04-11T20:24:24+00:00","description":"In this post I will show you how to install the latest Node.js on macOS Big Sur using node version manager.","breadcrumb":{"@id":"https:\/\/andrejacobs.org\/macos\/installing-node-js-on-macos-big-sur-using-nvm\/#breadcrumb"},"inLanguage":"en-GB","potentialAction":[{"@type":"ReadAction","target":["https:\/\/andrejacobs.org\/macos\/installing-node-js-on-macos-big-sur-using-nvm\/"]}]},{"@type":"BreadcrumbList","@id":"https:\/\/andrejacobs.org\/macos\/installing-node-js-on-macos-big-sur-using-nvm\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https:\/\/andrejacobs.org\/"},{"@type":"ListItem","position":2,"name":"Installing Node.js on macOS Big Sur using nvm"}]},{"@type":"WebSite","@id":"https:\/\/andrejacobs.org\/#website","url":"https:\/\/andrejacobs.org\/","name":"Andr\u00e9 Jacobs","description":"iOS Development, Electronics, Robotics, Artificial Intelligence, Business and Health","publisher":{"@id":"https:\/\/andrejacobs.org\/#\/schema\/person\/3d38360883015e883c80c2fb875c5a68"},"potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/andrejacobs.org\/?s={search_term_string}"},"query-input":"required name=search_term_string"}],"inLanguage":"en-GB"},{"@type":["Person","Organization"],"@id":"https:\/\/andrejacobs.org\/#\/schema\/person\/3d38360883015e883c80c2fb875c5a68","name":"Andr\u00e9 Jacobs","image":{"@type":"ImageObject","inLanguage":"en-GB","@id":"https:\/\/andrejacobs.org\/#\/schema\/person\/image\/","url":"https:\/\/andrejacobs.org\/wp-content\/uploads\/2019\/03\/andre_jacobs.jpg","contentUrl":"https:\/\/andrejacobs.org\/wp-content\/uploads\/2019\/03\/andre_jacobs.jpg","width":450,"height":450,"caption":"Andr\u00e9 Jacobs"},"logo":{"@id":"https:\/\/andrejacobs.org\/#\/schema\/person\/image\/"},"sameAs":["https:\/\/andrejacobs.org","https:\/\/www.youtube.com\/channel\/UCzqXvnd_UJ3sAzQkQBD-IVw"],"url":"https:\/\/andrejacobs.org\/author\/andre\/"}]}},"jetpack_sharing_enabled":true,"jetpack_featured_media_url":"https:\/\/andrejacobs.org\/wp-content\/uploads\/2021\/03\/lukas-hellebrand-E1S962T0g5c-unsplash.jpg","_links":{"self":[{"href":"https:\/\/andrejacobs.org\/wp-json\/wp\/v2\/posts\/184"}],"collection":[{"href":"https:\/\/andrejacobs.org\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/andrejacobs.org\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/andrejacobs.org\/wp-json\/wp\/v2\/users\/2"}],"replies":[{"embeddable":true,"href":"https:\/\/andrejacobs.org\/wp-json\/wp\/v2\/comments?post=184"}],"version-history":[{"count":2,"href":"https:\/\/andrejacobs.org\/wp-json\/wp\/v2\/posts\/184\/revisions"}],"predecessor-version":[{"id":196,"href":"https:\/\/andrejacobs.org\/wp-json\/wp\/v2\/posts\/184\/revisions\/196"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/andrejacobs.org\/wp-json\/wp\/v2\/media\/195"}],"wp:attachment":[{"href":"https:\/\/andrejacobs.org\/wp-json\/wp\/v2\/media?parent=184"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/andrejacobs.org\/wp-json\/wp\/v2\/categories?post=184"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/andrejacobs.org\/wp-json\/wp\/v2\/tags?post=184"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}