{"id":2016,"date":"2021-07-11T21:33:31","date_gmt":"2021-07-11T13:33:31","guid":{"rendered":"https:\/\/www.yusian.com\/blog\/?p=2016"},"modified":"2021-07-11T21:33:31","modified_gmt":"2021-07-11T13:33:31","slug":"%e8%a7%a3%e5%86%b3nvm%e5%af%bc%e8%87%b4%e7%bb%88%e7%ab%af%e5%90%af%e5%8a%a8%e6%85%a2%e7%9a%84%e9%97%ae%e9%a2%98","status":"publish","type":"post","link":"https:\/\/www.yusian.com\/blog\/macos\/2021\/07\/11\/2133312016.html","title":{"rendered":"\u89e3\u51b3nvm\u5bfc\u81f4\u7ec8\u7aef\u542f\u52a8\u6162\u7684\u95ee\u9898"},"content":{"rendered":"<p>\u95ee\u9898\u7684\u6839\u672c\u5c31\u662f.zshrc\u4e2d\u7684\u8fd9\u4e00\u6bb5\uff1a<\/p>\n<pre><code class=\"language-shell line-numbers\">export NVM_DIR=\"$HOME\/.nvm\"\n[ -s \"$NVM_DIR\/nvm.sh\" ] &amp;&amp; \\. \"$NVM_DIR\/nvm.sh\"  # This loads nvm\n[ -s \"$NVM_DIR\/bash_completion\" ] &amp;&amp; \\. \"$NVM_DIR\/bash_completion\"  # This loads nvm bash_completion\n<\/code><\/pre>\n<ul>\n<li>\u600e\u4e48\u89e3\u51b3\u5462\uff1f\u5f88\u7b80\u5355\uff0c\u5c06\u8fd9\u4e09\u884c\u6ce8\u91ca\u6389\uff01\u4e0d\u4fe1\u4f60\u8bd5\u8bd5\uff0c\u7ec8\u7aef\u79d2\u5f00\uff01\uff01\uff01<\/li>\n<li>\u53ef\u95ee\u9898\u662f\u6211\u5c06\u8fd9\u4e09\u884c\u6ce8\u91ca\u6389\u4e4b\u540e\uff0cnvm\u547d\u4ee4\u751a\u81f3node\u547d\u4ee4\u90fd\u6ca1\u4e86\uff0c\u600e\u4e48\u641e\uff1f\uff01<\/li>\n<li>\u5176\u5b9e\u89e3\u51b3\u529e\u6cd5\u5f88\u7b80\u5355\uff0c\u8fd9\u4e09\u884c\u547d\u4ee4\u5728\u7ec8\u7aef\u542f\u52a8\u7684\u65f6\u5019\u5c31\u52a0\u8f7d\uff0c\u8fd9\u5c31\u662f\u5fc5\u52a0\u8f7d\uff0c\u6211\u5c06\u4ed6\u4eec\u62f7\u8d1d\u51fa\u6765\uff0c\u653e\u5230\u4e00\u4e2a\u811a\u672c\u6587\u4ef6\u4e2d\uff0c\u9700\u8981\u7684\u65f6\u5019\u518d\u8fd0\u884c\u4e00\u4e0b\u4e0d\u5c31\u5b8c\u4e86\u5417\uff1f<\/li>\n<li>\u9700\u8981\u6ce8\u610f\u7684\u662f\uff0c\u8fd0\u884c\u8fd9\u4e2a\u811a\u672c\u7684\u65f6\u5019<strong>\u4e0d\u80fd\u4f7f\u7528sh<\/strong>\u547d\u4ee4\u8fd0\u884c\uff0c\u5f97<strong>\u4f7f\u7528source\u547d\u4ee4<\/strong>\u6267\u884c\uff01\u8fd9\u662f\u91cd\u70b9\uff01<\/li>\n<\/ul>\n","protected":false},"excerpt":{"rendered":"<p>\u95ee\u9898\u7684\u6839\u672c\u5c31\u662f.zshrc\u4e2d\u7684\u8fd9\u4e00\u6bb5\uff1a export NVM_DIR=&#8221;$HOME\/.nvm&#8221; [ -s &#8220;$NVM_DIR\/nvm.sh&#8221; ] &amp;&amp; \\. &#8220;$NVM_DIR\/nvm.sh&#8221; # This loads nvm [ -s &#8220;$NVM_DIR\/bash_completion&#8221; ] &amp;&amp; \\. &#8220;$NVM_DIR\/bash_completion&#8221; # This loads nvm bash_completion \u600e\u4e48\u89e3\u51b3\u5462\uff1f\u5f88\u7b80\u5355\uff0c\u5c06\u8fd9\u4e09\u884c\u6ce8\u91ca\u6389\uff01\u4e0d\u4fe1\u4f60\u8bd5\u8bd5\uff0c\u7ec8\u7aef\u79d2\u5f00\uff01\uff01\uff01 \u53ef\u95ee\u9898\u662f\u6211\u5c06\u8fd9\u4e09\u884c\u6ce8\u91ca\u6389\u4e4b\u540e\uff0cnvm\u547d\u4ee4\u751a\u81f3node\u547d\u4ee4\u90fd\u6ca1\u4e86\uff0c\u600e\u4e48\u641e\uff1f\uff01 \u5176\u5b9e\u89e3\u51b3\u529e\u6cd5\u5f88\u7b80\u5355\uff0c\u8fd9\u4e09\u884c\u547d\u4ee4\u5728\u7ec8\u7aef\u542f\u52a8\u7684\u65f6\u5019\u5c31\u52a0\u8f7d\uff0c\u8fd9\u5c31\u662f\u5fc5\u52a0\u8f7d\uff0c\u6211\u5c06\u4ed6\u4eec\u62f7\u8d1d\u51fa\u6765\uff0c\u653e\u5230\u4e00\u4e2a\u811a\u672c\u6587\u4ef6\u4e2d\uff0c\u9700\u8981\u7684\u65f6\u5019\u518d\u8fd0\u884c\u4e00\u4e0b\u4e0d\u5c31\u5b8c\u4e86\u5417\uff1f \u9700\u8981\u6ce8\u610f\u7684\u662f\uff0c\u8fd0\u884c\u8fd9\u4e2a\u811a\u672c\u7684\u65f6\u5019\u4e0d\u80fd\u4f7f\u7528sh\u547d\u4ee4\u8fd0\u884c\uff0c\u5f97\u4f7f\u7528source\u547d\u4ee4\u6267\u884c\uff01\u8fd9\u662f\u91cd\u70b9\uff01<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[12],"tags":[84,361,141],"class_list":["post-2016","post","type-post","status-publish","format-standard","hentry","category-macos","tag-node","tag-nvm","tag-141"],"_links":{"self":[{"href":"https:\/\/www.yusian.com\/blog\/wp-json\/wp\/v2\/posts\/2016","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.yusian.com\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.yusian.com\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.yusian.com\/blog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.yusian.com\/blog\/wp-json\/wp\/v2\/comments?post=2016"}],"version-history":[{"count":0,"href":"https:\/\/www.yusian.com\/blog\/wp-json\/wp\/v2\/posts\/2016\/revisions"}],"wp:attachment":[{"href":"https:\/\/www.yusian.com\/blog\/wp-json\/wp\/v2\/media?parent=2016"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.yusian.com\/blog\/wp-json\/wp\/v2\/categories?post=2016"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.yusian.com\/blog\/wp-json\/wp\/v2\/tags?post=2016"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}