{"id":42,"date":"2021-06-23T12:12:44","date_gmt":"2021-06-23T04:12:44","guid":{"rendered":"https:\/\/www.tysql.com\/?p=42"},"modified":"2021-06-23T12:12:44","modified_gmt":"2021-06-23T04:12:44","slug":"node-js%e5%ae%89%e8%a3%85%e6%95%99%e7%a8%8b","status":"publish","type":"post","link":"https:\/\/www.tysql.com\/index.php\/2021\/06\/23\/node-js%e5%ae%89%e8%a3%85%e6%95%99%e7%a8%8b\/","title":{"rendered":"node.js\u5b89\u88c5\u6559\u7a0b"},"content":{"rendered":"\n<h2 class=\"wp-block-heading\">\u4e00\u3001\u4f7f\u7528\u4e4b\u524d\uff0c\u6211\u4eec\u5148\u6765\u638c\u63e13\u4e2a\u4e1c\u897f\u662f\u7528\u6765\u5e72\u4ec0\u4e48\u7684\u3002<\/h2>\n\n\n\n<h2 class=\"wp-block-heading\">npm: Nodejs\u4e0b\u7684\u5305\u7ba1\u7406\u5668\u3002<\/h2>\n\n\n\n<h2 class=\"wp-block-heading\">webpack: \u5b83\u4e3b\u8981\u7684\u7528\u9014\u662f\u901a\u8fc7CommonJS\u7684\u8bed\u6cd5\u628a\u6240\u6709\u6d4f\u89c8\u5668\u7aef\u9700\u8981\u53d1\u5e03\u7684\u9759\u6001\u8d44\u6e90\u505a\u76f8\u5e94\u7684\u51c6\u5907\uff0c\u6bd4\u5982\u8d44\u6e90\u7684\u5408\u5e76\u548c\u6253\u5305\u3002<\/h2>\n\n\n\n<h2 class=\"wp-block-heading\">vue-cli: \u7528\u6237\u751f\u6210Vue\u5de5\u7a0b\u6a21\u677f\u3002\uff08\u5e2e\u4f60\u5feb\u901f\u5f00\u59cb\u4e00\u4e2avue\u7684\u9879\u76ee\uff0c\u4e5f\u5c31\u662f\u7ed9\u4f60\u4e00\u5957vue\u7684\u7ed3\u6784\uff0c\u5305\u542b\u57fa\u7840\u7684\u4f9d\u8d56\u5e93\uff0c\u53ea\u9700\u8981 npm install\u5c31\u53ef\u4ee5\u5b89\u88c5\uff09<\/h2>\n\n\n\n<h2 class=\"wp-block-heading\">\u5f00\u59cb\uff1a<\/h2>\n\n\n\n<div class=\"wp-block-codemirror-blocks-code-block code-block\"><pre class=\"CodeMirror\" data-setting=\"{&quot;showPanel&quot;:false,&quot;languageLabel&quot;:false,&quot;fullScreenButton&quot;:false,&quot;copyButton&quot;:true,&quot;mode&quot;:&quot;apl&quot;,&quot;mime&quot;:&quot;text\/apl&quot;,&quot;theme&quot;:&quot;darcula&quot;,&quot;lineNumbers&quot;:true,&quot;styleActiveLine&quot;:true,&quot;lineWrapping&quot;:false,&quot;readOnly&quot;:true,&quot;fileName&quot;:&quot;&quot;,&quot;language&quot;:&quot;APL&quot;,&quot;maxHeight&quot;:&quot;400px&quot;,&quot;modeName&quot;:&quot;apl&quot;}\">https:\/\/nodejs.org\/en\/<\/pre><\/div>\n\n\n\n<figure class=\"wp-block-image size-large\"><img loading=\"lazy\" decoding=\"async\" width=\"551\" height=\"398\" src=\"https:\/\/www.tysql.com\/wp-content\/uploads\/2021\/06\/1287619-20171212145017816-1078102167.png\" alt=\"\" class=\"wp-image-43\" srcset=\"https:\/\/www.tysql.com\/wp-content\/uploads\/2021\/06\/1287619-20171212145017816-1078102167.png 551w, https:\/\/www.tysql.com\/wp-content\/uploads\/2021\/06\/1287619-20171212145017816-1078102167-300x217.png 300w\" sizes=\"auto, (max-width: 551px) 100vw, 551px\" \/><\/figure>\n\n\n\n<p>\u5982\u56fe\uff0c\u4e0b\u8f7d8.9.3 LTS \uff08\u63a8\u8350\u7ed9\u7edd\u5927\u90e8\u5206\u7528\u6237\u4f7f\u7528\uff09<\/p>\n\n\n\n<p>\u4e0b\u8f7d\u5b89\u88c5\uff0c\u53ef\u4ee5\u4f7f\u7528\u9ed8\u8ba4\u8def\u5f84\uff0c\u672c\u4f8b\u5b50\u4e2d\u81ea\u884c\u4fee\u6539\u4e3ad:\\nodejs<\/p>\n\n\n\n<figure class=\"wp-block-image size-large is-resized\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/www.tysql.com\/wp-content\/uploads\/2021\/06\/1287619-20171212145307316-1352109111.png\" alt=\"\" class=\"wp-image-44\" width=\"499\" height=\"390\" srcset=\"https:\/\/www.tysql.com\/wp-content\/uploads\/2021\/06\/1287619-20171212145307316-1352109111.png 495w, https:\/\/www.tysql.com\/wp-content\/uploads\/2021\/06\/1287619-20171212145307316-1352109111-300x235.png 300w\" sizes=\"auto, (max-width: 499px) 100vw, 499px\" \/><\/figure>\n\n\n\n<p>\u4e00\u8def\u70b9Next\uff0c\u70b9Finish\u5b8c\u6210<\/p>\n\n\n\n<p>\u6253\u5f00CMD\uff0c\u68c0\u67e5\u662f\u5426\u6b63\u5e38<\/p>\n\n\n\n<p><\/p>\n\n\n\n<figure class=\"wp-block-image size-large\"><img loading=\"lazy\" decoding=\"async\" width=\"500\" height=\"418\" src=\"https:\/\/www.tysql.com\/wp-content\/uploads\/2021\/06\/1287619-20171212145657082-1826714804.png\" alt=\"\" class=\"wp-image-45\" srcset=\"https:\/\/www.tysql.com\/wp-content\/uploads\/2021\/06\/1287619-20171212145657082-1826714804.png 500w, https:\/\/www.tysql.com\/wp-content\/uploads\/2021\/06\/1287619-20171212145657082-1826714804-300x251.png 300w\" sizes=\"auto, (max-width: 500px) 100vw, 500px\" \/><\/figure>\n\n\n\n<h3 class=\"wp-block-heading\">\u518d\u770b\u770b\u53e6\u59162\u4e2a\u76ee\u5f55\uff0cnpm\u7684\u672c\u5730\u4ed3\u5e93\u8dd1\u5728\u7cfb\u7edf\u76d8c\u76d8\u7684\u7528\u6237\u76ee\u5f55\u4e86(\u6ca1\u89c1\u5230npm-cache\u662f\u56e0\u4e3a\u6ca1\u6709\u7528\u8fc7\uff0c\u4e00\u4f7f\u7528\u7f13\u5b58\u76ee\u5f55\u5c31\u751f\u6210\u4e86)\uff0c\u6211\u4eec\u8bd5\u56fe\u628a\u8fd92\u4e2a\u76ee\u5f55\u79fb\u52a8\u56de\u5230D:\\nodejs<\/h3>\n\n\n\n<h3 class=\"wp-block-heading\">\u5148\u5982\u4e0b\u56fe\u5efa\u7acb2\u4e2a\u76ee\u5f55<\/h3>\n\n\n\n<figure class=\"wp-block-image size-large\"><img loading=\"lazy\" decoding=\"async\" width=\"324\" height=\"322\" src=\"https:\/\/www.tysql.com\/wp-content\/uploads\/2021\/06\/1287619-20171212145811019-407092018.png\" alt=\"\" class=\"wp-image-46\" srcset=\"https:\/\/www.tysql.com\/wp-content\/uploads\/2021\/06\/1287619-20171212145811019-407092018.png 324w, https:\/\/www.tysql.com\/wp-content\/uploads\/2021\/06\/1287619-20171212145811019-407092018-300x298.png 300w, https:\/\/www.tysql.com\/wp-content\/uploads\/2021\/06\/1287619-20171212145811019-407092018-150x150.png 150w\" sizes=\"auto, (max-width: 324px) 100vw, 324px\" \/><\/figure>\n\n\n\n<p>\u7136\u540e\u8fd0\u884c\u4ee5\u4e0b2\u6761\u547d\u4ee4<\/p>\n\n\n\n<div class=\"wp-block-codemirror-blocks-code-block code-block\"><pre class=\"CodeMirror\" data-setting=\"{&quot;showPanel&quot;:false,&quot;languageLabel&quot;:false,&quot;fullScreenButton&quot;:false,&quot;copyButton&quot;:true,&quot;mode&quot;:&quot;apl&quot;,&quot;mime&quot;:&quot;text\/apl&quot;,&quot;theme&quot;:&quot;darcula&quot;,&quot;lineNumbers&quot;:true,&quot;styleActiveLine&quot;:true,&quot;lineWrapping&quot;:false,&quot;readOnly&quot;:true,&quot;fileName&quot;:&quot;&quot;,&quot;language&quot;:&quot;APL&quot;,&quot;maxHeight&quot;:&quot;400px&quot;,&quot;modeName&quot;:&quot;apl&quot;}\">npm config set prefix &quot;D:\\nodejs\\node_global&quot;\nnpm config set cache &quot;D:\\nodejs\\node_cache&quot;<\/pre><\/div>\n\n\n\n<p>\u8f93\u5165 npm list -global \u53ef\u4ee5\u770b\u5230\u76ee\u5f55\u5df2\u7ecf\u6539\u53d8\u4e86<\/p>\n\n\n\n<figure class=\"wp-block-image\"><img decoding=\"async\" src=\"https:\/\/www.tysql.com\/wp-content\/uploads\/2021\/06\/1287619-20171212145854347-808420142.png\" alt=\"\u6b64\u56fe\u7247\u7684alt\u5c5e\u6027\u4e3a\u7a7a\uff1b\u6587\u4ef6\u540d\u4e3a1287619-20171212145854347-808420142.png\"\/><\/figure>\n\n\n\n<p>\u8f93\u5165\u547d\u4ee4npm config set registry=http:\/\/registry.npm.taobao.org \u914d\u7f6e\u955c\u50cf\u7ad9<\/p>\n\n\n\n<p>\u68c0\u67e5\u4e00\u4e0b\u955c\u50cf\u7ad9\u884c\u4e0d\u884c\u547d\u4ee4 npm config get registry<\/p>\n\n\n\n<p>Npm info vue \u770b\u770b\u80fd\u5426\u83b7\u5f97vue\u7684\u4fe1\u606f<\/p>\n\n\n\n<p><\/p>\n\n\n\n<h3 class=\"wp-block-heading\">\u6ce8\u610f\uff0c\u6b64\u65f6\uff0c\u9ed8\u8ba4\u7684\u6a21\u5757D:\\nodejs\\node_modules \u76ee\u5f55<\/h3>\n\n\n\n<h3 class=\"wp-block-heading\">\u5c06\u4f1a\u6539\u53d8\u4e3aD:\\nodejs\\node_global\\node_modules \u76ee\u5f55\uff0c<\/h3>\n\n\n\n<h3 class=\"wp-block-heading\">\u5982\u679c\u76f4\u63a5\u8fd0\u884cnpm install\u7b49\u547d\u4ee4\u4f1a\u62a5\u9519\u7684\u3002<\/h3>\n\n\n\n<h3 class=\"wp-block-heading\">\u6211\u4eec\u9700\u8981\u505a1\u4ef6\u4e8b\u60c5\uff1a<\/h3>\n\n\n\n<h3 class=\"wp-block-heading\">1\u3001\u589e\u52a0\u73af\u5883\u53d8\u91cfNODE_PATH \u5185\u5bb9\u662f\uff1aD:\\nodejs\\node_global\\node_modules<\/h3>\n\n\n\n<figure class=\"wp-block-image size-large\"><img loading=\"lazy\" decoding=\"async\" width=\"461\" height=\"175\" src=\"https:\/\/www.tysql.com\/wp-content\/uploads\/2021\/06\/1287619-20171212150402894-2086448836.png\" alt=\"\" class=\"wp-image-48\" srcset=\"https:\/\/www.tysql.com\/wp-content\/uploads\/2021\/06\/1287619-20171212150402894-2086448836.png 461w, https:\/\/www.tysql.com\/wp-content\/uploads\/2021\/06\/1287619-20171212150402894-2086448836-300x114.png 300w\" sizes=\"auto, (max-width: 461px) 100vw, 461px\" \/><\/figure>\n\n\n\n<p><\/p>\n\n\n\n<h3 class=\"wp-block-heading\">\uff08\u6ce8\u610f\uff0c\u4e00\u4e0b\u64cd\u4f5c\u9700\u8981\u91cd\u65b0\u6253\u5f00CMD\u8ba9\u4e0a\u9762\u7684\u73af\u5883\u53d8\u91cf\u751f\u6548\uff09<\/h3>\n\n\n\n<h3 class=\"wp-block-heading\">\u4e00\u3001\u6d4b\u8bd5NPM\u5b89\u88c5vue.js<\/h3>\n\n\n\n<h3 class=\"wp-block-heading\">\u547d\u4ee4\uff1anpm install vue -g<\/h3>\n\n\n\n<h3 class=\"wp-block-heading\">\u8fd9\u91cc\u7684-g\u662f\u6307\u5b89\u88c5\u5230global\u5168\u5c40\u76ee\u5f55\u53bb<\/h3>\n\n\n\n<figure class=\"wp-block-image size-large\"><img loading=\"lazy\" decoding=\"async\" width=\"601\" height=\"254\" src=\"https:\/\/www.tysql.com\/wp-content\/uploads\/2021\/06\/1287619-20171212150420488-1331978539.png\" alt=\"\" class=\"wp-image-49\" srcset=\"https:\/\/www.tysql.com\/wp-content\/uploads\/2021\/06\/1287619-20171212150420488-1331978539.png 601w, https:\/\/www.tysql.com\/wp-content\/uploads\/2021\/06\/1287619-20171212150420488-1331978539-300x127.png 300w\" sizes=\"auto, (max-width: 601px) 100vw, 601px\" \/><\/figure>\n\n\n\n<h3 class=\"wp-block-heading\">\u4e8c\u3001\u6d4b\u8bd5NPM\u5b89\u88c5vue-router<\/h3>\n\n\n\n<h3 class=\"wp-block-heading\">\u547d\u4ee4\uff1anpm install vue-router -g<\/h3>\n\n\n\n<figure class=\"wp-block-image size-large\"><img loading=\"lazy\" decoding=\"async\" width=\"328\" height=\"243\" src=\"https:\/\/www.tysql.com\/wp-content\/uploads\/2021\/06\/1287619-20171212150544879-938347487.png\" alt=\"\" class=\"wp-image-50\" srcset=\"https:\/\/www.tysql.com\/wp-content\/uploads\/2021\/06\/1287619-20171212150544879-938347487.png 328w, https:\/\/www.tysql.com\/wp-content\/uploads\/2021\/06\/1287619-20171212150544879-938347487-300x222.png 300w\" sizes=\"auto, (max-width: 328px) 100vw, 328px\" \/><\/figure>\n\n\n\n<p>\u8fd0\u884cnpm install vue-cli -g\u5b89\u88c5vue\u811a\u624b\u67b6<\/p>\n\n\n\n<figure class=\"wp-block-image size-large\"><img loading=\"lazy\" decoding=\"async\" width=\"717\" height=\"399\" src=\"https:\/\/www.tysql.com\/wp-content\/uploads\/2021\/06\/1287619-20171212150805238-349743368.png\" alt=\"\" class=\"wp-image-51\" srcset=\"https:\/\/www.tysql.com\/wp-content\/uploads\/2021\/06\/1287619-20171212150805238-349743368.png 717w, https:\/\/www.tysql.com\/wp-content\/uploads\/2021\/06\/1287619-20171212150805238-349743368-300x167.png 300w\" sizes=\"auto, (max-width: 717px) 100vw, 717px\" \/><\/figure>\n\n\n\n<p><\/p>\n\n\n\n<figure class=\"wp-block-image size-large\"><img loading=\"lazy\" decoding=\"async\" width=\"234\" height=\"97\" src=\"https:\/\/www.tysql.com\/wp-content\/uploads\/2021\/06\/1287619-20171212150836707-1925918113.png\" alt=\"\" class=\"wp-image-52\"\/><\/figure>\n\n\n\n<p class=\"has-huge-font-size\"><strong>\u7f16\u8f91\u73af\u5883\u7f16\u8f91path<\/strong><\/p>\n\n\n\n<h3 class=\"has-normal-font-size wp-block-heading\">\u5bf9path\u73af\u5883\u53d8\u91cf\u6dfb\u52a0D:\\nodejs\\node_global<\/h3>\n\n\n\n<h3 class=\"has-normal-font-size wp-block-heading\">win10\u4ee5\u4e0b\u7248\u672c\u7684\uff0c\u6a2a\u5411\u663e\u793aPATH\u7684\uff0c\u6ce8\u610f\u6dfb\u52a0\u5230\u6700\u540e\u65f6\uff0c\u4e0d\u8981\u6709\u5206\u53f7\u3010;\u3011<\/h3>\n\n\n\n<figure class=\"wp-block-image size-large\"><img loading=\"lazy\" decoding=\"async\" width=\"363\" height=\"225\" src=\"https:\/\/www.tysql.com\/wp-content\/uploads\/2021\/06\/1287619-20171212150853863-1117215657.png\" alt=\"\" class=\"wp-image-53\" srcset=\"https:\/\/www.tysql.com\/wp-content\/uploads\/2021\/06\/1287619-20171212150853863-1117215657.png 363w, https:\/\/www.tysql.com\/wp-content\/uploads\/2021\/06\/1287619-20171212150853863-1117215657-300x186.png 300w\" sizes=\"auto, (max-width: 363px) 100vw, 363px\" \/><\/figure>\n\n\n\n<p><\/p>\n\n\n\n<figure class=\"wp-block-image size-large\"><img loading=\"lazy\" decoding=\"async\" width=\"542\" height=\"218\" src=\"https:\/\/www.tysql.com\/wp-content\/uploads\/2021\/06\/1287619-20171212150928332-1178968243.png\" alt=\"\" class=\"wp-image-54\" srcset=\"https:\/\/www.tysql.com\/wp-content\/uploads\/2021\/06\/1287619-20171212150928332-1178968243.png 542w, https:\/\/www.tysql.com\/wp-content\/uploads\/2021\/06\/1287619-20171212150928332-1178968243-300x121.png 300w\" sizes=\"auto, (max-width: 542px) 100vw, 542px\" \/><\/figure>\n\n\n\n<p>\u539f\u6587\u5730\u5740 <a href=\"https:\/\/www.cnblogs.com\/goldlong\/p\/8027997.html\">https:\/\/www.cnblogs.com\/goldlong\/p\/8027997.html<\/a><\/p>\n","protected":false},"excerpt":{"rendered":"<p>\u4e00\u3001\u4f7f\u7528\u4e4b\u524d\uff0c\u6211\u4eec\u5148\u6765\u638c\u63e13\u4e2a\u4e1c\u897f\u662f\u7528\u6765\u5e72\u4ec0\u4e48\u7684\u3002 npm: Nodejs\u4e0b\u7684\u5305\u7ba1\u7406\u5668\u3002 webpack: \u5b83 &hellip; <a href=\"https:\/\/www.tysql.com\/index.php\/2021\/06\/23\/node-js%e5%ae%89%e8%a3%85%e6%95%99%e7%a8%8b\/\" class=\"more-link\">\u7ee7\u7eed\u9605\u8bfb<span class=\"screen-reader-text\">node.js\u5b89\u88c5\u6559\u7a0b<\/span><\/a><\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[4],"tags":[],"class_list":["post-42","post","type-post","status-publish","format-standard","hentry","category-qianduan"],"_links":{"self":[{"href":"https:\/\/www.tysql.com\/index.php\/wp-json\/wp\/v2\/posts\/42","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.tysql.com\/index.php\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.tysql.com\/index.php\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.tysql.com\/index.php\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.tysql.com\/index.php\/wp-json\/wp\/v2\/comments?post=42"}],"version-history":[{"count":1,"href":"https:\/\/www.tysql.com\/index.php\/wp-json\/wp\/v2\/posts\/42\/revisions"}],"predecessor-version":[{"id":55,"href":"https:\/\/www.tysql.com\/index.php\/wp-json\/wp\/v2\/posts\/42\/revisions\/55"}],"wp:attachment":[{"href":"https:\/\/www.tysql.com\/index.php\/wp-json\/wp\/v2\/media?parent=42"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.tysql.com\/index.php\/wp-json\/wp\/v2\/categories?post=42"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.tysql.com\/index.php\/wp-json\/wp\/v2\/tags?post=42"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}