{"id":319,"date":"2021-11-14T15:44:09","date_gmt":"2021-11-14T07:44:09","guid":{"rendered":"http:\/\/gjweb.top\/?p=319"},"modified":"2023-07-11T10:07:03","modified_gmt":"2023-07-11T02:07:03","slug":"node%e5%a4%9a%e7%89%88%e6%9c%ac%e7%ae%a1%e7%90%86%e5%b7%a5%e5%85%b7","status":"publish","type":"post","link":"https:\/\/gjweb.top\/?p=319","title":{"rendered":"Node\u591a\u7248\u672c\u7ba1\u7406\u5de5\u5177"},"content":{"rendered":"\n<p>\u4f7f\u7528nvm \u5728 Windows \u8ba1\u7b97\u673a\u4e0a\u7ba1\u7406 node.js \u7684\u591a\u4e2a\u5b89\u88c5 , <a href=\"https:\/\/github.com\/coreybutler\/nvm-windows\/releases\">\u524d\u5f80\u4e0b\u8f7d<\/a><\/p>\n\n\n\n<h2 class=\"wp-block-heading\" id=\"window\u5b89\u88c5\u586b\u5751\">window\u5b89\u88c5\u586b\u5751<\/h2>\n\n\n\n<p><strong>\u4e0d\u8981<\/strong> \u5c06 nvm <strong>\u5b89\u88c5\u5230 C\u76d8<\/strong> !! , \u5982\u679c\u5b89\u88c5\u5230C\u76d8\u5207\u6362\u7248\u672c\u7684\u65f6\u5019\u4f1a\u51fa\u73b0 <strong>&#8220;\u62d2\u7edd\u8bbf\u95ee&#8221;<\/strong> \u7684\u62a5\u9519\u4fe1\u606f<\/p>\n\n\n\n<p>\u5b89\u88c5\u5b8c\u6210\u540e\u9700\u8981\u7ba1\u7406\u5458\u8eab\u4efd\u8fd0\u884c porwerShell \u8fdb\u884c\u4e00\u4e0b\u547d\u4ee4<\/p>\n\n\n\n<hr class=\"wp-block-separator\"\/>\n\n\n\n<h2 class=\"wp-block-heading\" id=\"nvm-\u547d\u4ee4\">nvm \u547d\u4ee4<\/h2>\n\n\n\n<ul class=\"wp-block-list\"><li><strong><code>nvm arch [32|64]<\/code><\/strong>\uff1a\u663e\u793a\u8282\u70b9\u662f\u5728 32 \u4f4d\u8fd8\u662f 64 \u4f4d\u6a21\u5f0f\u4e0b\u8fd0\u884c\u3002\u6307\u5b9a 32 \u6216 64 \u4ee5\u8986\u76d6\u9ed8\u8ba4\u4f53\u7cfb\u7ed3\u6784\u3002<\/li><li><strong><code>nvm current<\/code><\/strong>: \u663e\u793a\u6d3b\u52a8\u7248\u672c\u3002<\/li><li><strong><code>nvm install [arch]<\/code><\/strong>\uff1a\u7248\u672c\u53ef\u4ee5\u662f\u7279\u5b9a\u7248\u672c\uff0c\u201clatest\u201d\u8868\u793a\u6700\u65b0\u7684\u5f53\u524d\u7248\u672c\uff0c\u201clts\u201d\u8868\u793a\u6700\u65b0\u7684 LTS \u7248\u672c\u3002\uff08\u53ef\u9009\uff09\u6307\u5b9a\u662f\u5b89\u88c5 32 \u4f4d\u8fd8\u662f 64 \u4f4d\u7248\u672c\uff08\u9ed8\u8ba4\u4e3a\u7cfb\u7edf\u67b6\u6784\uff09\u3002\u5c06 [arch] \u8bbe\u7f6e\u4e3a\u201call\u201d\u4ee5\u5b89\u88c5 32 \u4f4d\u548c 64 \u4f4d\u7248\u672c\u3002\u6dfb\u52a0<code>--insecure<\/code>\u5230\u6b64\u547d\u4ee4\u7684\u672b\u5c3e\u4ee5\u7ed5\u8fc7\u8fdc\u7a0b\u4e0b\u8f7d\u670d\u52a1\u5668\u7684 SSL \u9a8c\u8bc1\u3002<\/li><li><strong><code>nvm list [available]<\/code><\/strong>\uff1a\u5217\u51fa node.js \u5b89\u88c5\u3002<code>available<\/code>\u5728\u672b\u5c3e\u952e\u5165\u4ee5\u663e\u793a\u53ef\u4f9b\u4e0b\u8f7d\u7684\u7248\u672c\u5217\u8868\u3002<\/li><li><strong><code>nvm on<\/code><\/strong>: \u542f\u7528 node.js \u7248\u672c\u7ba1\u7406\u3002<\/li><li><strong><code>nvm off<\/code><\/strong>\uff1a\u7981\u7528 node.js \u7248\u672c\u7ba1\u7406\uff08\u4e0d\u5378\u8f7d\u4efb\u4f55\u4e1c\u897f\uff09\u3002<\/li><li><strong><code>nvm proxy [url]<\/code><\/strong>\uff1a\u8bbe\u7f6e\u7528\u4e8e\u4e0b\u8f7d\u7684\u4ee3\u7406\u3002\u7559<code>[url]<\/code>\u7a7a\u767d\uff0c\u4ee5\u67e5\u770b\u5f53\u524d\u7684\u4ee3\u7406\u3002\u8bbe\u7f6e<code>[url]<\/code>\u4e3a\u201cnone\u201d\u4ee5\u5220\u9664\u4ee3\u7406\u3002<\/li><li><strong><code>nvm uninstall<\/code><\/strong>: \u5378\u8f7d\u7279\u5b9a\u7248\u672c\u3002<\/li><li><strong><code>nvm use [arch]<\/code><\/strong>: \u5207\u6362\u5230\u4f7f\u7528\u6307\u5b9a\u7684\u7248\u672c\u3002\u6709\u9009\u62e9\u5730\u4f7f\u7528<code>latest<\/code>\uff0c<code>lts<\/code>\u6216<code>newest<\/code>\u3002<code>newest<\/code>\u662f\u6700\u65b0<em>\u5b89\u88c5\u7684<\/em>\u7248\u672c\u3002\uff08\u53ef\u9009\uff09\u6307\u5b9a 32\/64 \u4f4d\u67b6\u6784\u3002<code>nvm use<\/code>\u5c06\u7ee7\u7eed\u4f7f\u7528\u6240\u9009\u7248\u672c\uff0c\u4f46\u5207\u6362\u5230 32\/64 \u4f4d\u6a21\u5f0f\u3002\u6709\u5173<code>use<\/code>\u5728\u7279\u5b9a\u76ee\u5f55\u4e2d\u4f7f\u7528\uff08\u6216\u4f7f\u7528<code>.nvmrc<\/code>\uff09\u7684\u4fe1\u606f\uff0c\u8bf7\u53c2\u9605<a href=\"https:\/\/github.com\/coreybutler\/nvm-windows\/issues\/16\">\u95ee\u9898 #16<\/a>\u3002<\/li><li><strong><code>nvm root<\/code><\/strong>: \u8bbe\u7f6envm\u5b58\u653e\u4e0d\u540c\u7248\u672cnode.js\u7684\u76ee\u5f55\u3002\u5982\u679c&#8220;\u672a\u8bbe\u7f6e\uff0c\u5c06\u663e\u793a\u5f53\u524d\u6839\u3002<\/li><li>** <code>nvm version<\/code>\uff1a\u663e\u793a\u5f53\u524d\u8fd0\u884c\u7684 NVM for Windows \u7248\u672c\u3002<\/li><li><strong><code>nvm node_mirror<\/code><\/strong>: \u8bbe\u7f6e\u8282\u70b9\u955c\u50cf\u3002\u56fd\u5185\u53ef\u4ee5\u4f7f\u7528<em><a href=\"https:\/\/npm.taobao.org\/mirrors\/node\/\">https:\/\/npm.taobao.org\/mirrors\/node\/<\/a><\/em><\/li><li><strong><code>nvm npm_mirror<\/code><\/strong>: \u8bbe\u7f6enpm\u955c\u50cf\u3002\u56fd\u5185\u53ef\u4ee5\u4f7f\u7528<em><a href=\"https:\/\/npm.taobao.org\/mirrors\/npm\/\">https:\/\/npm.taobao.org\/mirrors\/npm\/<\/a><\/em><\/li><\/ul>\n\n\n\n<hr class=\"wp-block-separator\"\/>\n\n\n\n<h2 class=\"wp-block-heading\" id=\"centos-\u5b89\u88c5-nvm-\u914d\u7f6e\u56fd\u5185\u955c\u50cf\">centos \u5b89\u88c5 nvm \u914d\u7f6e\u56fd\u5185\u955c\u50cf<\/h2>\n\n\n\n<p>\u6839\u636e <a href=\"https:\/\/github.com\/nvm-sh\/nvm\">nvm\u5728github<\/a> \u7684\u5b89\u88c5\u6b65\u9aa4\uff0c \u8fdb\u5165 vim root \/ .bashrc \u4e2d\u914d\u7f6e\uff0c \u5728\u6700\u540e\u4e00\u884c\u6dfb\u52a0<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>export NVM_NODEJS_ORG_MIRROR=https:\/\/npm.taobao.org\/mirrors\/node<\/code><\/pre>\n\n\n\n<p><\/p>\n","protected":false},"excerpt":{"rendered":"<p>\u4f7f\u7528nvm \u5728 Windows \u8ba1\u7b97\u673a\u4e0a\u7ba1\u7406 node.js \u7684\u591a\u4e2a\u5b89\u88c5 , \u524d\u5f80\u4e0b\u8f7d window\u5b89\u88c5\u586b\u5751  [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[22],"tags":[],"class_list":["post-319","post","type-post","status-publish","format-standard","hentry","category-node-js"],"_links":{"self":[{"href":"https:\/\/gjweb.top\/index.php?rest_route=\/wp\/v2\/posts\/319","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/gjweb.top\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/gjweb.top\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/gjweb.top\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/gjweb.top\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=319"}],"version-history":[{"count":1,"href":"https:\/\/gjweb.top\/index.php?rest_route=\/wp\/v2\/posts\/319\/revisions"}],"predecessor-version":[{"id":743,"href":"https:\/\/gjweb.top\/index.php?rest_route=\/wp\/v2\/posts\/319\/revisions\/743"}],"wp:attachment":[{"href":"https:\/\/gjweb.top\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=319"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/gjweb.top\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=319"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/gjweb.top\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=319"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}