{"id":10065,"date":"2021-06-04T10:00:17","date_gmt":"2021-06-04T01:00:17","guid":{"rendered":"https:\/\/www.gigas-jp.com\/appnews\/?p=10065"},"modified":"2021-06-03T20:43:09","modified_gmt":"2021-06-03T11:43:09","slug":"how-to-install-node-js-and-npm-in-your-macos","status":"publish","type":"post","link":"https:\/\/www.gigas-jp.com\/appnews\/archives\/10065","title":{"rendered":"How to install Node.js and NPM in your MacOS"},"content":{"rendered":"\n<p>Yesterday I wanted to install NPM with package download, such kind of command error message occurred.<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>Command on found on zsh<\/code><\/pre>\n\n\n\n<p>Then I try to add new some command, I got it zsh shell command. So this time I would like to share you how to install both Node.js and NPM with MacOs for new terminal.<\/p>\n\n\n\n<h4 id=\"1fa2\">Prerequisites<\/h4>\n\n\n\n<p>Firstly  by typing <code>git<\/code> that will show you command line tools installed.<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>git<\/code><\/pre>\n\n\n\n<p>To see what shell your terminal currently is in, from the command line type in:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>echo $0<\/code><\/pre>\n\n\n\n<p>If you\u2019re in the&nbsp;<code>bash<\/code>&nbsp;shell, you\u2019ll see printed out:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>-bash<\/code><\/pre>\n\n\n\n<p>If you\u2019re in the&nbsp;<code>zsh<\/code>&nbsp;shell, you\u2019ll see printed out:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>-zsh<\/code><\/pre>\n\n\n\n<h4 id=\"b88f\">Switch Your Default Shell To&nbsp;<code>zsh<\/code><\/h4>\n\n\n\n<p>To switch your shell to the&nbsp;<code>zsh<\/code>&nbsp;shell, you may enter:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>chsh -s \/bin\/zsh<\/code><\/pre>\n\n\n\n<p>To switch back to the bash shell, you may enter:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>chsh -s \/bin\/bash<\/code><\/pre>\n\n\n\n<h4 id=\"356c\">Step by step installation<\/h4>\n\n\n\n<p>Make a directory and enter the folder and add this really nifty package manager for <code>zsh<\/code> called antigen.zsh<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>curl -L git.io\/antigen > antigen.zsh<\/code><\/pre>\n\n\n\n<p>Now we\u2019re going to configure our&nbsp;<code>.zshrc<\/code>&nbsp;file:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>nano ~\/.zshrc<\/code><\/pre>\n\n\n\n<p>Then you\u2019ll want to write such kind of .zshrc file: <\/p>\n\n\n\n<figure class=\"wp-block-image\"><img loading=\"lazy\" width=\"568\" height=\"342\" src=\"\/appnews\/wp-content\/uploads\/sites\/4\/2021\/06\/Screen-Shot-2021-06-03-at-14.36.32.png\" alt=\"\" class=\"wp-image-10066\"\/><\/figure>\n\n\n\n<p>Then restart your terminal. Now you can finally install Node.js and NPM with a single line using nvm!<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>nvm install --lts<\/code><\/pre>\n\n\n\n<p>I hope you have found this useful.&nbsp;<\/p>\n\n\n\n<p>By Ami<\/p>\n<div class='wp_social_bookmarking_light'>\n            <div class=\"wsbl_google_plus_one\"><g:plusone size=\"medium\" annotation=\"none\" href=\"https:\/\/www.gigas-jp.com\/appnews\/archives\/10065\" ><\/g:plusone><\/div>\n            <div class=\"wsbl_hatena_button\"><a href=\"\/\/b.hatena.ne.jp\/entry\/https:\/\/www.gigas-jp.com\/appnews\/archives\/10065\" class=\"hatena-bookmark-button\" data-hatena-bookmark-title=\"How to install Node.js and NPM in your MacOS\" data-hatena-bookmark-layout=\"standard\" title=\"\u3053\u306e\u30a8\u30f3\u30c8\u30ea\u30fc\u3092\u306f\u3066\u306a\u30d6\u30c3\u30af\u30de\u30fc\u30af\u306b\u8ffd\u52a0\"> <img src=\"\/\/b.hatena.ne.jp\/images\/entry-button\/button-only@2x.png\" alt=\"\u3053\u306e\u30a8\u30f3\u30c8\u30ea\u30fc\u3092\u306f\u3066\u306a\u30d6\u30c3\u30af\u30de\u30fc\u30af\u306b\u8ffd\u52a0\" width=\"20\" height=\"20\" style=\"border: none;\" \/><\/a><script type=\"text\/javascript\" src=\"\/\/b.hatena.ne.jp\/js\/bookmark_button.js\" charset=\"utf-8\" async=\"async\"><\/script><\/div>\n            <div class=\"wsbl_twitter\"><a href=\"https:\/\/twitter.com\/share\" class=\"twitter-share-button\" data-url=\"https:\/\/www.gigas-jp.com\/appnews\/archives\/10065\" data-text=\"How to install Node.js and NPM in your MacOS\" data-via=\"GIGASJAPAN_APPS\" data-lang=\"ja\">Tweet<\/a><\/div>\n            <div class=\"wsbl_facebook_like\"><div id=\"fb-root\"><\/div><fb:like href=\"https:\/\/www.gigas-jp.com\/appnews\/archives\/10065\" layout=\"button_count\" action=\"like\" width=\"100\" share=\"false\" show_faces=\"false\" ><\/fb:like><\/div>\n            <div class=\"wsbl_facebook_send\"><div id=\"fb-root\"><\/div><fb:send href=\"https:\/\/www.gigas-jp.com\/appnews\/archives\/10065\" colorscheme=\"light\" ><\/fb:send><\/div>\n    <\/div>\n<br class='wp_social_bookmarking_light_clear' \/>\n","protected":false},"excerpt":{"rendered":"<p>Yesterday I wanted to install NPM with package download, such kind of command error message occurred. Then I t [&hellip;]<\/p>\n","protected":false},"author":19,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":[],"categories":[100],"tags":[],"acf":[],"_links":{"self":[{"href":"https:\/\/www.gigas-jp.com\/appnews\/wp-json\/wp\/v2\/posts\/10065"}],"collection":[{"href":"https:\/\/www.gigas-jp.com\/appnews\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.gigas-jp.com\/appnews\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.gigas-jp.com\/appnews\/wp-json\/wp\/v2\/users\/19"}],"replies":[{"embeddable":true,"href":"https:\/\/www.gigas-jp.com\/appnews\/wp-json\/wp\/v2\/comments?post=10065"}],"version-history":[{"count":7,"href":"https:\/\/www.gigas-jp.com\/appnews\/wp-json\/wp\/v2\/posts\/10065\/revisions"}],"predecessor-version":[{"id":10075,"href":"https:\/\/www.gigas-jp.com\/appnews\/wp-json\/wp\/v2\/posts\/10065\/revisions\/10075"}],"wp:attachment":[{"href":"https:\/\/www.gigas-jp.com\/appnews\/wp-json\/wp\/v2\/media?parent=10065"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.gigas-jp.com\/appnews\/wp-json\/wp\/v2\/categories?post=10065"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.gigas-jp.com\/appnews\/wp-json\/wp\/v2\/tags?post=10065"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}