{"id":20555,"date":"2024-11-19T16:45:42","date_gmt":"2024-11-19T08:45:42","guid":{"rendered":"https:\/\/fwq.ai\/blog\/20555\/"},"modified":"2024-11-19T16:45:42","modified_gmt":"2024-11-19T08:45:42","slug":"vscode%e6%80%8e%e4%b9%88%e5%bf%ab%e9%80%9f%e8%bf%90%e8%a1%8c","status":"publish","type":"post","link":"https:\/\/fwq.ai\/blog\/20555\/","title":{"rendered":"vscode\u600e\u4e48\u5feb\u901f\u8fd0\u884c"},"content":{"rendered":"<blockquote><p>\n  \u6709\u56db\u79cd\u5728 vscode \u4e2d\u5feb\u901f\u8fd0\u884c\u4ee3\u7801\u7684\u65b9\u6cd5\uff1a\u4f7f\u7528\u5feb\u6377\u952e (windows\/linux\uff1actrl + f5\uff0cmacos\uff1acmd + f5)\u901a\u8fc7\u83dc\u5355\u680f\u7684\u201c\u8fd0\u884c\u201d\u9009\u9879\u5229\u7528\u542f\u52a8\u914d\u7f6e\uff08\u5728 settings.json \u4e2d\u81ea\u5b9a\u4e49\u8fd0\u884c\u8bbe\u7f6e\uff09\u76f4\u63a5\u5728\u7ec8\u7aef\u4e2d\u4f7f\u7528 node \u547d\u4ee4\n<\/p><\/blockquote>\n<p><img decoding=\"async\" src=\"https:\/\/img.php.cn\/upload\/article\/202404\/03\/2024040305242160438.jpg\" class=\"aligncenter\" title=\"vscode\u600e\u4e48\u5feb\u901f\u8fd0\u884c\u63d2\u56fe\" alt=\"vscode\u600e\u4e48\u5feb\u901f\u8fd0\u884c\u63d2\u56fe\" \/><\/p>\n<p><strong>\u5982\u4f55\u5728 Visual Studio Code \u4e2d\u5feb\u901f\u8fd0\u884c\u4ee3\u7801<\/strong><\/p>\n<p>Visual Studio Code (VSCode) \u662f\u4e00\u6b3e\u6d41\u884c\u7684\u4ee3\u7801\u7f16\u8f91\u5668\uff0c\u5b83\u63d0\u4f9b\u4e86\u591a\u79cd\u65b9\u6cd5\u6765\u5feb\u901f\u8fd0\u884c\u4ee3\u7801\u3002<\/p>\n<p><strong>1. \u4f7f\u7528\u5feb\u6377\u952e<\/strong><\/p>\n<ul>\n<li> <strong>Windows\/Linux\uff1a<\/strong> Ctrl + F5<\/li>\n<li> <strong>macOS\uff1a<\/strong> Cmd + F5<\/li>\n<\/ul>\n<p>\u6b64\u5feb\u6377\u952e\u5c06\u4f7f\u7528\u5f53\u524d\u9ed8\u8ba4\u7684\u8fd0\u884c\u914d\u7f6e\u8fd0\u884c\u4ee3\u7801\u3002<\/p>\n<p><strong>2. \u4f7f\u7528\u83dc\u5355\u680f<\/strong><\/p>\n<ul>\n<li>\u5355\u51fb\u83dc\u5355\u680f\u4e0a\u7684\u201c\u8fd0\u884c\u201d\u83dc\u5355\u3002<\/li>\n<li>\u9009\u62e9\u201c\u8fd0\u884c\u201d\u6216\u201c\u8c03\u8bd5\u201d\u3002<\/li>\n<\/ul>\n<p><strong>3. \u4f7f\u7528\u542f\u52a8\u914d\u7f6e<\/strong><\/p>\n<p>\u542f\u52a8\u914d\u7f6e\u5141\u8bb8\u60a8\u81ea\u5b9a\u4e49\u4ee3\u7801\u7684\u8fd0\u884c\u65b9\u5f0f\u3002\u521b\u5efa\u542f\u52a8\u914d\u7f6e\uff1a<\/p>\n<ul>\n<li>\u5728 VSCode \u4e2d\u6253\u5f00 settings.json \u6587\u4ef6\uff08\u6587\u4ef6 &gt; \u9996\u9009\u9879 &gt; \u8bbe\u7f6e\uff09\u3002<\/li>\n<li>\u6dfb\u52a0 \u201claunch\u201d \u90e8\u5206\uff0c\u5982\u4e0b\u6240\u793a\uff1a<\/li>\n<\/ul>\n<pre>{\n  \"version\": \"0.2.0\",\n  \"configurations\": [\n    {\n      \"type\": \"node\",\n      \"request\": \"launch\",\n      \"name\": \"Launch Program\",\n      \"program\": \"${workspaceFolder}\/app.js\",\n      \"args\": []\n    }\n  ]\n}<\/pre>\n<p> \u767b\u5f55\u540e\u590d\u5236 <\/p>\n<ul>\n<li>\u5c06 \u201cprogram\u201d \u5b57\u6bb5\u4fee\u6539\u4e3a\u60a8\u7684\u811a\u672c\u6587\u4ef6\u8def\u5f84\u3002<\/li>\n<li>\u4fdd\u5b58 settings.json \u6587\u4ef6\u3002<\/li>\n<\/ul>\n<p><strong>4. \u5728\u7ec8\u7aef\u4e2d\u8fd0\u884c<\/strong><\/p>\n<ul>\n<li>\u6253\u5f00\u96c6\u6210\u7ec8\u7aef\uff08\u7ec8\u7aef &gt; \u65b0\u5efa\u7ec8\u7aef\uff09\u3002<\/li>\n<li>\u5bfc\u822a\u5230\u811a\u672c\u6240\u5728\u76ee\u5f55\u3002<\/li>\n<li>\u8f93\u5165\u4ee5\u4e0b\u547d\u4ee4\u8fd0\u884c\u811a\u672c\uff1a<\/li>\n<\/ul>\n<pre>node &lt;script_file_name&gt;<\/pre>\n<p> \u767b\u5f55\u540e\u590d\u5236 <\/p>\n<p><strong>\u63d0\u793a\uff1a<\/strong><\/p>\n<ul>\n<li>\u5982\u679c\u60a8\u5728\u8fd0\u884c\u4ee3\u7801\u65f6\u9047\u5230\u95ee\u9898\uff0c\u8bf7\u68c0\u67e5\u63a7\u5236\u53f0\u7a97\u53e3\u4e2d\u7684\u9519\u8bef\u6d88\u606f\u3002<\/li>\n<li>VSCode \u8fd8\u63d0\u4f9b\u8c03\u8bd5\u5de5\u5177\uff0c\u5141\u8bb8\u60a8\u9010\u6b65\u6267\u884c\u4ee3\u7801\u5e76\u68c0\u67e5\u53d8\u91cf\u503c\u3002<\/li>\n<li>\u60a8\u8fd8\u53ef\u4ee5\u5b89\u88c5\u6269\u5c55\u7a0b\u5e8f\uff0c\u4f8b\u5982 &#8220;Code Runner&#8221;\uff0c\u4ee5\u8fdb\u4e00\u6b65\u7b80\u5316\u8fd0\u884c\u4ee3\u7801\u7684\u8fc7\u7a0b\u3002<\/li>\n<\/ul>\n<p>\u4ee5\u4e0a\u5c31\u662f\u600e\u4e48\u5feb\u901f\u8fd0\u884c\u7684\u8be6\u7ec6\u5185\u5bb9\uff0c\u66f4\u591a\u8bf7\u5173\u6ce8\u7c73\u4e91\u5176\u5b83\u76f8\u5173\u6587\u7ae0\uff01<\/p>\n","protected":false},"excerpt":{"rendered":"<p>\u6709\u56db\u79cd\u5728 vscode \u4e2d\u5feb\u901f\u8fd0\u884c\u4ee3\u7801\u7684\u65b9\u6cd5\uff1a\u4f7f\u7528\u5feb\u6377\u952e (windows\/linux\uff1actrl + f5\uff0cmacos\uff1acmd + f5)\u901a\u8fc7\u83dc\u5355\u680f\u7684\u201c\u8fd0\u884c\u201d\u9009\u9879\u5229\u7528\u542f\u52a8\u914d\u7f6e\uff08\u5728 settings.json \u4e2d\u81ea\u5b9a\u4e49\u8fd0\u884c\u8bbe\u7f6e\uff09\u76f4\u63a5\u5728\u7ec8\u7aef\u4e2d\u4f7f\u7528 node \u547d\u4ee4 \u5982\u4f55\u5728 Visual Studio Code \u4e2d\u5feb\u901f\u8fd0\u884c\u4ee3\u7801 Visual Studio Code (VSCode) \u662f\u4e00\u6b3e\u6d41\u884c\u7684\u4ee3\u7801\u7f16\u8f91\u5668\uff0c\u5b83\u63d0\u4f9b\u4e86\u591a\u79cd\u65b9\u6cd5\u6765\u5feb\u901f\u8fd0\u884c\u4ee3\u7801\u3002 1. \u4f7f\u7528\u5feb\u6377\u952e Windows\/Linux\uff1a Ctrl + F5 macOS\uff1a Cmd + F5 \u6b64\u5feb\u6377\u952e\u5c06\u4f7f\u7528\u5f53\u524d\u9ed8\u8ba4\u7684\u8fd0\u884c\u914d\u7f6e\u8fd0\u884c\u4ee3\u7801\u3002 2. \u4f7f\u7528\u83dc\u5355\u680f \u5355\u51fb\u83dc\u5355\u680f\u4e0a\u7684\u201c\u8fd0\u884c\u201d\u83dc\u5355\u3002 \u9009\u62e9\u201c\u8fd0\u884c\u201d\u6216\u201c\u8c03\u8bd5\u201d\u3002 3. \u4f7f\u7528\u542f\u52a8\u914d\u7f6e \u542f\u52a8\u914d\u7f6e\u5141\u8bb8\u60a8\u81ea\u5b9a\u4e49\u4ee3\u7801\u7684\u8fd0\u884c\u65b9\u5f0f\u3002\u521b\u5efa\u542f\u52a8\u914d\u7f6e\uff1a \u5728 VSCode \u4e2d\u6253\u5f00 settings.json \u6587\u4ef6\uff08\u6587\u4ef6 &gt; \u9996\u9009\u9879 &gt; \u8bbe\u7f6e\uff09\u3002 \u6dfb\u52a0 \u201claunch\u201d \u90e8\u5206\uff0c\u5982\u4e0b\u6240\u793a\uff1a { &#8220;version&#8221;: &#8220;0.2.0&#8221;, [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"closed","ping_status":"","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[16],"tags":[],"class_list":["post-20555","post","type-post","status-publish","format-standard","hentry","category-16"],"_links":{"self":[{"href":"https:\/\/fwq.ai\/blog\/wp-json\/wp\/v2\/posts\/20555","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/fwq.ai\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/fwq.ai\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/fwq.ai\/blog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/fwq.ai\/blog\/wp-json\/wp\/v2\/comments?post=20555"}],"version-history":[{"count":0,"href":"https:\/\/fwq.ai\/blog\/wp-json\/wp\/v2\/posts\/20555\/revisions"}],"wp:attachment":[{"href":"https:\/\/fwq.ai\/blog\/wp-json\/wp\/v2\/media?parent=20555"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/fwq.ai\/blog\/wp-json\/wp\/v2\/categories?post=20555"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/fwq.ai\/blog\/wp-json\/wp\/v2\/tags?post=20555"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}