{"id":8274,"date":"2022-05-10T21:20:09","date_gmt":"2022-05-10T13:20:09","guid":{"rendered":"https:\/\/blog.ywdevops.cn\/?p=8274"},"modified":"2025-10-11T16:43:40","modified_gmt":"2025-10-11T08:43:40","slug":"node","status":"publish","type":"post","link":"https:\/\/blog.ywdevops.cn\/index.php\/2022\/05\/10\/node\/","title":{"rendered":"linux\u5b89\u88c5node.js\u4e0enpm"},"content":{"rendered":"\n<p class=\"wp-block-paragraph\">node.js\u662fjavascript(js)\u7684\u8fd0\u884c\u73af\u5883\uff0c\u662f\u4e00\u4e2a\u670d\u52a1\u5668\u7aef\u7684javascript\u7684\u89e3\u91ca\u5668\uff0cnpm\u5219\u662fnode.js\u7684\u5305\u7ba1\u7406\u5668\uff0c\u4ed6\u4eec\u4e4b\u95f4\u662f\u5305\u542b\u5173\u7cfb\uff0c\u53ef\u4ee5\u901a\u8fc7npm\u4e0b\u8f7d\u5404\u79cdjs\u4ee3\u7801\u3002<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">1\u3001\u9996\u5148\u53bb\u5b98\u7f51\u4e0b\u8f7d\u5b89\u88c5\u5305\uff1a<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">\u70b9\u51fb\u94fe\u63a5\u4e0b\u8f7d\uff1a<a rel=\"noreferrer noopener\" href=\"http:\/\/nodejs.cn\/download\/\" target=\"_blank\">Node\u4e2d\u6587\u7f51<\/a>\u6216\u8005\u5730\u5740https:\/\/nodejs.org\/download\/release\/latest-v16.x\/<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">\u5386\u53f2\u7248\u672c\u4e0b\u8f7d\uff1ahttps:\/\/nodejs.org\/dist\/v10.15.3\/<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>https:&#47;&#47;nodejs.org\/zh-cn\/download\/archive\/v23.11.1<\/code><\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">alpine\u517c\u5bb9\u7248\u672c\u4e0b\u8f7d\u5730\u5740\uff1a<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>https:&#47;&#47;unofficial-builds.nodejs.org\/download\/release\/<\/code><\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">2\u3001\u89e3\u538b\u7f29\u5305\uff1a<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>tar -xf node-v16.15.0-linux-x64.tar.xz<\/code><\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">3\u3001\u79fb\u52a8\u5230\u8981\u5b89\u88c5\u7684\u4f4d\u7f6e\uff0c\u5e76\u521b\u5efa\u8f6f\u94fe\u63a5\uff1a<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>mv node-v16.15.0-linux-x64  \/usr\/local\/node\nln -s \/usr\/local\/node\/bin\/node \/usr\/bin\/node\nln -s \/usr\/local\/node\/bin\/npm  \/usr\/bin\/npm<\/code><\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">4\u3001\u5b89\u88c5\u540e\u901a\u8fc7\u547d\u4ee4\u67e5\u770b\u662f\u5426\u5b89\u88c5\u6210\u529f\uff1a<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>node  -v     #\u67e5\u770bnode\u7248\u672c\nnpm   -v     #\u67e5\u770bnpm\u7248\u672c<\/code><\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">5\u3001\u4fee\u6539\u955c\u50cf\u7ad9\u4e3a\u56fd\u5185\u955c\u50cf\u7ad9\uff0c\u547d\u4ee4\u5982\u4e0b\uff1a<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>npm config get registry             #\u67e5\u770b\u5f53\u524d\u955c\u50cf\u5730\u5740\uff0c\u9ed8\u8ba4\u4e3a\u5b98\u65b9\u955c\u50cf\u5730https:\/\/registry.npmjs.org\nnpm config set registry \u955c\u50cf\u5730\u5740    #\u8bbe\u7f6e\u56fd\u5185\u955c\u50cf\nnpm config get registry             #\u9a8c\u8bc1\u8bbe\u7f6e\u4e4b\u540e\u7684\u5730\u5740<\/code><\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">\u4e3b\u6d41\u955c\u50cf\u5730\u5740\u5982\u4e0b\uff1a<\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li>npm config set registry http:\/\/mirrors.cloud.tencent.com\/npm\/                            #\u817e\u8baf<\/li>\n\n\n\n<li>npm config set registry https:\/\/registry.npmmirror.com                                        #\u963f\u91cc<\/li>\n\n\n\n<li>npm config set registry https:\/\/mirrors.huaweicloud.com\/repository\/npm\/         #\u534e\u4e3a<\/li>\n\n\n\n<li>npm config set registry https:\/\/npm.aliyun.com                                                    #\u963f\u91cc\u4e91<\/li>\n\n\n\n<li>npm config set registry https:\/\/registry.npmjs.org\/                                               #\u5b98\u65b9\u5e93<\/li>\n<\/ul>\n\n\n\n<p class=\"has-luminous-vivid-amber-background-color has-background wp-block-paragraph\">\u6ce8\uff1a\u8fd8\u53ef\u4ee5\u4f7f\u7528\u6dd8\u5b9d\u5b9a\u5236\u7684cnpm\uff0c\u9700\u8981\u5355\u72ec\u5b89\u88c5<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">6\u3001npm\u5168\u5c40\u5b89\u88c5vue-cli\uff1a<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>npm install -g @vue\/cli\nln -s \/usr\/local\/node\/bin\/vue \/usr\/bin\/vue\nvue -V<\/code><\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">7\u3001\u521b\u5efa\u9879\u76ee\uff1a<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>vue create new-project<\/code><\/pre>\n\n\n\n<figure class=\"wp-block-image size-full\"><img loading=\"lazy\" decoding=\"async\" width=\"706\" height=\"620\" src=\"https:\/\/blog.ywdevops.cn\/wp-content\/uploads\/2022\/05\/10.png\" alt=\"\" class=\"wp-image-8372\" srcset=\"https:\/\/blog.ywdevops.cn\/wp-content\/uploads\/2022\/05\/10.png 706w, https:\/\/blog.ywdevops.cn\/wp-content\/uploads\/2022\/05\/10-300x263.png 300w, https:\/\/blog.ywdevops.cn\/wp-content\/uploads\/2022\/05\/10-600x527.png 600w\" sizes=\"auto, (max-width: 706px) 100vw, 706px\" \/><\/figure>\n","protected":false},"excerpt":{"rendered":"<p>node.js\u662fjavascript(js)\u7684\u8fd0\u884c\u73af\u5883\uff0c\u662f\u4e00\u4e2a\u670d\u52a1\u5668\u7aef\u7684javascript\u7684\u89e3\u91ca\u5668\uff0cnpm\u5219 [&hellip;]<\/p>\n","protected":false},"author":3,"featured_media":8281,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[34,22],"tags":[152],"class_list":["post-8274","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-linux","category-server","tag-node"],"blocksy_meta":{"styles_descriptor":{"styles":{"desktop":"","tablet":"","mobile":""},"google_fonts":[],"version":8}},"_links":{"self":[{"href":"https:\/\/blog.ywdevops.cn\/index.php\/wp-json\/wp\/v2\/posts\/8274","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/blog.ywdevops.cn\/index.php\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/blog.ywdevops.cn\/index.php\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/blog.ywdevops.cn\/index.php\/wp-json\/wp\/v2\/users\/3"}],"replies":[{"embeddable":true,"href":"https:\/\/blog.ywdevops.cn\/index.php\/wp-json\/wp\/v2\/comments?post=8274"}],"version-history":[{"count":19,"href":"https:\/\/blog.ywdevops.cn\/index.php\/wp-json\/wp\/v2\/posts\/8274\/revisions"}],"predecessor-version":[{"id":19138,"href":"https:\/\/blog.ywdevops.cn\/index.php\/wp-json\/wp\/v2\/posts\/8274\/revisions\/19138"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/blog.ywdevops.cn\/index.php\/wp-json\/wp\/v2\/media\/8281"}],"wp:attachment":[{"href":"https:\/\/blog.ywdevops.cn\/index.php\/wp-json\/wp\/v2\/media?parent=8274"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/blog.ywdevops.cn\/index.php\/wp-json\/wp\/v2\/categories?post=8274"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/blog.ywdevops.cn\/index.php\/wp-json\/wp\/v2\/tags?post=8274"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}