{"id":47,"date":"2022-04-20T13:53:32","date_gmt":"2022-04-20T05:53:32","guid":{"rendered":"https:\/\/www.icfyless.com\/?p=47"},"modified":"2022-04-20T13:53:32","modified_gmt":"2022-04-20T05:53:32","slug":"m1%e8%8a%af%e7%89%87mac%e6%90%ad%e5%bb%ba%e5%89%8d%e7%ab%af%e5%bc%80%e5%8f%91%e7%8e%af%e5%a2%83","status":"publish","type":"post","link":"https:\/\/www.icfyless.com\/index.php\/2022\/04\/20\/m1%e8%8a%af%e7%89%87mac%e6%90%ad%e5%bb%ba%e5%89%8d%e7%ab%af%e5%bc%80%e5%8f%91%e7%8e%af%e5%a2%83\/","title":{"rendered":"M1\u82af\u7247mac\u642d\u5efa\u524d\u7aef\u5f00\u53d1\u73af\u5883"},"content":{"rendered":"\n<p>\u6587\u7ae0\u5f15\u7528\u81ea\uff1a<a href=\"https:\/\/segmentfault.com\/a\/1190000039005726\" data-type=\"URL\" data-id=\"https:\/\/segmentfault.com\/a\/1190000039005726\">https:\/\/segmentfault.com\/a\/1190000039005726<\/a> <\/p>\n\n\n\n<ul class=\"wp-block-list\"><li>\u5b89\u88c5Xcode<\/li><li>\u5b89\u88c5HomeBrew<\/li><li>\u5b89\u88c5Nvm<\/li><li>\u5b89\u88c5node<\/li><li>\u5982\u4f55\u5b89\u88c5V14\u53ca\u4e00\u4e0b\u8001\u7248\u672cNode<\/li><\/ul>\n\n\n\n<h3 class=\"wp-block-heading\">\u5b89\u88c5Xcode<\/h3>\n\n\n\n<p>Xcode \u662f\u82f9\u679c\u5f00\u53d1\u8005\u5de5\u5177\uff0c\u662f\u4e00\u4e2a\u529f\u80fd\u975e\u5e38\u5f3a\u5927\u7684 IDE\uff0c\u53ef\u4ee5\u7528\u6765\u5f00\u53d1\u82f9\u679c\u5e94\u7528\uff0c\u5e76\u4e14\u81ea\u5e26\u4e86 git \u73af\u5883, \u5e76\u4e14\u6709\u54b1\u4eec\u540e\u7eed\u4f9d\u8d56\u7684 Xcode Command line tool , \u5148\u8fdb\u5165 app store \u4e2d\u5b89\u88c5 Xcode\u3002\u5b89\u88c5\u597d\u4e4b\u540e\u518d\u8fdb\u5165\u540e\u7eed\u6b65\u9aa4<\/p>\n\n\n\n<h3 class=\"wp-block-heading\">\u5b89\u88c5HomeBrew<\/h3>\n\n\n\n<p>\u5982\u679c\u4f60\u662f\u4e00\u4e2a mac \u8001\u7528\u6237\uff0c\u90a3\u81ea\u7136\u4e0d\u7528\u6211\u4ecb\u7ecd\u4ec0\u4e48\u662f\u00a0<a rel=\"noreferrer noopener\" href=\"https:\/\/link.segmentfault.com\/?enc=xhiFUwTPNXhfvzKahl68Uw%3D%3D.vXo45kK3S6I%2BA%2FoD1KxXY%2FlHgIavPuEuwtJavluaQag%3D\" target=\"_blank\">Homebrew<\/a>\u3002\u82e5\u662f\u4f60\u662f\u4e00\u4e2a\u65b0\u7528\u6237\uff0c\u90a3\u4e48\u8bf7\u4f60\u4e00\u5b9a\u8981\u5b89\u88c5 Homebrew \uff0c\u5e76\u4f7f\u7528\u5b83\u6765\u7ba1\u7406 Mac \u4e2d\u7684\u5404\u7c7b\u73af\u5883\u4f9d\u8d56\u3002\u901a\u8fc7\ud83d\udc47\u7684\u547d\u4ee4\u5373\u53ef\u5b89\u88c5 Homebrew<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>\/bin\/bash -c \"$(curl -fsSL https:\/\/raw.githubusercontent.com\/Homebrew\/install\/HEAD\/install.sh)\"<\/code><\/pre>\n\n\n\n<p>\u5728\u7ec8\u7aef\u4e2d\u6267\u884c\u5982\u4e0b\u547d\u4ee4\u5b89\u88c5 Homebrew\uff0c\u5b89\u88c5 Homebrew \u7684\u65f6\u5019\uff0c\u5e38\u5e38\u4f1a\u56e0\u4e3a\u7f51\u7edc\u95ee\u9898\u5bfc\u81f4\u5b89\u88c5\u5931\u8d25,\u8fd9\u4e2a\u95ee\u9898\u53ea\u80fd\u4f9d\u8d56\u5927\u5bb6\u81ea\u884c\u89e3\u51b3\u79d1\u5b66\u4e0a\u7f51\u4e86\u3002<\/p>\n\n\n\n<h3 class=\"wp-block-heading\">\u5b89\u88c5Nvm<\/h3>\n\n\n\n<p>Nvm \u662f\u4e00\u4e2a\u7ba1\u7406 Node \u7248\u672c\u7684\u5de5\u5177\uff0c\u5f53\u9879\u76ee\u591a\u4e86\u4ee5\u540e\uff0c\u603b\u4f1a\u78b0\u5230\u9700\u8981\u5207\u6362 Node \u73af\u5883\u7684\u65f6\u5019\uff0c\u6240\u4ee5\u63a8\u8350\u5927\u5bb6\u4f7f\u7528 Nvm \u6765\u5b89\u88c5 Node\u3002<\/p>\n\n\n\n<h4 class=\"wp-block-heading\">HomeBrew\u5b89\u88c5Nvm<\/h4>\n\n\n\n<p>\u82e5\u662f\u4f60\u5df2\u7ecf\u6309\u4e0a\u8ff0\u6b65\u9aa4\u5b89\u88c5\u597d\u4e86 Homebrew\uff0c\u90a3\u4e48\u4f60\u53ef\u4ee5\u76f4\u63a5\u901a\u8fc7 Homebrew \u7684\u547d\u4ee4\u8f7b\u677e\u5b89\u88c5 Nvm<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>brew install nvm<\/code><\/pre>\n\n\n\n<h4 class=\"wp-block-heading\">curl\u5b89\u88c5Nvm<\/h4>\n\n\n\n<p>\u82e5\u662f\u4f60\u4e0d\u60f3\u4f7f\u7528 Homebrew \u7ba1\u7406\u4f9d\u8d56\uff0c\u90a3\u4e48\u7528 \ud83d\udc47 \u7684 curl \u76f4\u63a5\u5b89\u88c5 Nvm \u4e5f\u662f\u53ef\u4ee5\u7684<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>curl -o- https:\/\/raw.githubusercontent.com\/nvm-sh\/nvm\/v0.37.2\/install.sh | bash<\/code><\/pre>\n\n\n\n<h4 class=\"wp-block-heading\">\u8bbe\u7f6eNvm\u7684\u73af\u5883\u53d8\u91cf<\/h4>\n\n\n\n<p>\u5b89\u88c5\u597d nvm \u540e\uff0c\u9700\u8981\u5c06\u73af\u5883\u53d8\u91cf\u5199\u5165\u6211\u4eec\u7684 shell \u914d\u7f6e\u6587\u4ef6\u4e2d\u3002<\/p>\n\n\n\n<p>\u5982\u679c\u4f60\u7684\u9ed8\u8ba4 shell \u7684 zsh\uff0c\u90a3\u4e48\u5c06\u73af\u5883\u53d8\u91cf\u547d\u4ee4\u590d\u5236\u8fdb\u00a0<code>.zshrc<\/code>:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>vi ~\/.bash_profile<\/code><\/pre>\n\n\n\n<p>\u5982\u679c\u4e0d\u4f7f\u7528 zsh\uff0c\u90a3\u4e48\u5c06\u73af\u5883\u53d8\u91cf\u590d\u5236\u8fdb bash \u4e2d\uff0c\u901a\u8fc7\u5982\u4e0b\u547d\u4ee4\u521b\u5efa bash_profile\uff0c\u5e76\u4e14\u7f16\u8f91 bash_profile\u3002<\/p>\n\n\n\n<p>\u81f3\u6b64 Nvm \u5df2\u7ecf\u5b89\u88c5\u597d\uff0c\u53ef\u4ee5\u5c1d\u8bd5\u5728\u547d\u4ee4\u884c\u4e2d\u8f93\u5165 nvm\uff0c\u4f60\u53ef\u4ee5\u770b\u5230 nvm \u5df2\u7ecf\u6b63\u5e38\u5de5\u4f5c\u4e86\u3002<\/p>\n\n\n\n<h3 class=\"wp-block-heading\">\u5b89\u88c5Node<\/h3>\n\n\n\n<p>\u63a5\u4e0b\u6765\u6211\u4eec\u901a\u8fc7 nvm \u6765\u5b89\u88c5 Node\uff0c\u6211\u4eec\u5148\u5b89\u88c5\u9002\u914d\u4e86 M1 \u7684 node \u7248\u672c\u3002<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>nvm i v15<\/code><\/pre>\n\n\n\n<p>\u8be5\u547d\u4ee4\u8fd0\u884c\u5b8c\u540e\uff0c\u4f1a\u6267\u884c\u5f88\u4e45\uff0c\u7f16\u8bd1 node \uff0c\u5927\u5bb6\u8010\u5fc3\u7b49\u5c31\u597d\u4e86\uff0c\u5927\u6982\u9700\u8981 5-10 \u5206\u949f\uff0c\u5c31\u4f1a\u63d0\u793a\u5b89\u88c5\u6210\u529f\u3002\u518d\u63d0\u9192\u4e00\u53e5\uff0c\u62a5\u4efb\u4f55\u9519\u8bef\uff0c\u9996\u5148\u5148\u68c0\u67e5\u662f\u4e0d\u662f\u7f51\u7edc\u95ee\u9898\uff0c\u4f8b\u5982 443 \u3001 connect timeout \u7b49\uff0c\u5982\u679c\u662f\u7f51\u7edc\u95ee\u9898\uff0c\u5efa\u8bae\u79d1\u5b66\u4e0a\u7f51\u3002<\/p>\n\n\n\n<h3 class=\"wp-block-heading\">\u5982\u4f55\u5b89\u88c5 v14 \u53ca\u4ee5\u4e0b\u7684\u8001\u7248\u672c Node<\/h3>\n\n\n\n<p>\u5b89\u88c5 Node \u7684\u90e8\u5206\u5199\u7684\u5f88\u7b80\u5355\uff0c\u56e0\u4e3a\u6309\u8fd9\u4e2a\u6b65\u9aa4\uff0c\u4e00\u822c\u4e0d\u4f1a\u51fa\u95ee\u9898\u3002\u800c\u5f53\u4f60\u7528 nvm \u5c1d\u8bd5\u53bb\u5b89\u88c5 v14 \u53ca\u4ee5\u4e0b\u7684 Node \u7248\u672c\u65f6\uff0c\u5927\u6982\u7387\u4f1a\u62a5\u9519\uff0c\u800c\u6211\u4eec\u5728\u5de5\u4f5c\u4e2d\u6070\u6070\u53c8\u53ef\u80fd\u4f9d\u8d56 v14 \u53ca\u4ee5\u4e0b\u7684 lts \u7248\u672c\u3002\u90a3\u4e48\u4e3a\u4ec0\u4e48\u4f1a\u62a5\u9519\u5462\uff1f\u7a76\u5176\u539f\u56e0\u8fd8\u662f\u56e0\u4e3a\u4f4e\u7248\u672c\u7684 node \u5e76\u4e0d\u662f\u57fa\u4e8e arm64 \u67b6\u6784\u7684\uff0c\u6240\u4ee5\u4e0d\u9002\u914d M1 \u82af\u7247\u3002\u5728\u8fd9\u91cc\u6559\u5927\u5bb6\u4e24\u4e2a\u65b9\u6cd5\uff0c\u5c31\u80fd\u6210\u529f\u5b89\u88c5\u4e0a\u4f4e\u7248\u672c Node\u3002<\/p>\n\n\n\n<h4 class=\"wp-block-heading\">\u65b9\u6cd5\u4e00<\/h4>\n\n\n\n<p>\u5728\u7ec8\u7aef\u4e2d\uff0c\u8f93\u5165\uff1a<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>arch -x86_64 zsh<\/code><\/pre>\n\n\n\n<p class=\"has-black-color has-text-color\">\u901a\u8fc7\u8fd9\u4e2a\u547d\u4ee4\u53ef\u4ee5\u8ba9 shell \u8fd0\u884c\u5728Rosetta2\u4e0b\u3002<br>\u4e4b\u540e\u4f60\u53ef\u4ee5\u901a\u8fc7\u00a0<code>nvm install v12<\/code>\u00a0\u6765\u5b89\u88c5\u4f4e\u7248\u672c Node\u3002<br>\u5728\u6b64\u4e4b\u540e\uff0c\u60a8\u53ef\u4ee5\u4e0d\u7528\u5728 Rosetta2 \u4e2d\u5c31\u53ef\u4ee5\u4f7f\u7528\u5b89\u88c5\u7684\u53ef\u6267\u884c\u6587\u4ef6\uff0c\u4e5f\u5c31\u662f\u8bf4\uff0c\u60a8\u53ef\u4ee5\u5c06 Node v15\u4e0e\u5176\u4ed6\u8282\u70b9\u7248\u672c\u4e92\u6362\u4f7f\u7528\u3002<\/p>\n\n\n\n<h4 class=\"wp-block-heading\">\u65b9\u6cd5\u4e8c<\/h4>\n\n\n\n<p>\u65b9\u6cd5\u4e8c\u5c31\u662f\u901a\u8fc7 Rosetta2 \u6765\u542f\u52a8\u7ec8\u7aef\uff0c\u8fd9\u6837\u901a\u8fc7 Rosetta2 \u8f6c\u8bd1\u5230 x86 \u67b6\u6784\u4e2d\u6267\u884c\u5b89\u88c5\uff0c\u4e5f\u4e00\u6837\u53ef\u4ee5\u5b89\u88c5\u6210\u529f\u3002<\/p>\n\n\n\n<ul class=\"wp-block-list\"><li>\u5728finder\u4e2d\uff0c\u70b9\u51fb\u5e94\u7528\u7a0b\u5e8f\uff0c\u5e76\u5728\u4f7f\u7528\u5de5\u5177\u4e2d\u627e\u5230\u7ec8\u7aef\uff08Terminal\uff09<\/li><li>\u53f3\u952e\u7ec8\u7aef\uff0c\u70b9\u51fb\u83b7\u53d6\u4fe1\u606f<\/li><li>\u9009\u62e9 \u4f7f\u7528Rosetta\u6253\u5f00<\/li><li>\u91cd\u542f\u7ec8\u7aef\uff0c\u5e76\u6267\u884c <code>nvm install v12<\/code> \u547d\u4ee4<\/li><\/ul>\n\n\n\n<figure class=\"wp-block-image size-large\"><img decoding=\"async\" data-size=\"large\" src=\"http:\/\/icfy-1256883275.file.myqcloud.com\/2022\/04\/20\/625f9f641c9d1.webp\" alt=\"\"\/><\/figure>\n\n\n\n<figure class=\"wp-block-image size-large\"><img decoding=\"async\" data-size=\"large\" src=\"http:\/\/icfy-1256883275.file.myqcloud.com\/2022\/04\/20\/625f9f3da93f8.webp\" alt=\"\"\/><\/figure>\n\n\n\n<p><\/p>\n","protected":false},"excerpt":{"rendered":"<p>\u6587\u7ae0\u5f15\u7528\u81ea\uff1ahttps:\/\/segmentfaul &hellip;<\/p>\n","protected":false},"author":1,"featured_media":48,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[8],"tags":[],"class_list":["post-47","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-mac"],"_links":{"self":[{"href":"https:\/\/www.icfyless.com\/index.php\/wp-json\/wp\/v2\/posts\/47","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.icfyless.com\/index.php\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.icfyless.com\/index.php\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.icfyless.com\/index.php\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.icfyless.com\/index.php\/wp-json\/wp\/v2\/comments?post=47"}],"version-history":[{"count":1,"href":"https:\/\/www.icfyless.com\/index.php\/wp-json\/wp\/v2\/posts\/47\/revisions"}],"predecessor-version":[{"id":49,"href":"https:\/\/www.icfyless.com\/index.php\/wp-json\/wp\/v2\/posts\/47\/revisions\/49"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/www.icfyless.com\/index.php\/wp-json\/wp\/v2\/media\/48"}],"wp:attachment":[{"href":"https:\/\/www.icfyless.com\/index.php\/wp-json\/wp\/v2\/media?parent=47"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.icfyless.com\/index.php\/wp-json\/wp\/v2\/categories?post=47"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.icfyless.com\/index.php\/wp-json\/wp\/v2\/tags?post=47"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}