{"id":21358,"date":"2024-11-19T12:01:38","date_gmt":"2024-11-19T04:01:38","guid":{"rendered":"https:\/\/fwq.ai\/blog\/21358\/"},"modified":"2024-11-19T12:01:38","modified_gmt":"2024-11-19T04:01:38","slug":"vscode%e6%80%8e%e4%b9%88%e8%bf%90%e8%a1%8cnodejs","status":"publish","type":"post","link":"https:\/\/fwq.ai\/blog\/21358\/","title":{"rendered":"vscode\u600e\u4e48\u8fd0\u884cnodejs"},"content":{"rendered":"<blockquote><p>\n  \u53ef\u4ee5\u4f7f\u7528 visual studio code (vs code) \u8fd0\u884c node.js \u4ee3\u7801\uff0c\u6b65\u9aa4\u5305\u542b\uff1a\u5b89\u88c5 node.js\u6253\u5f00 vs code\u914d\u7f6e vs code \u4ee5\u652f\u6301 node.js\u521b\u5efa node.js \u6587\u4ef6\u7f16\u5199 node.js \u4ee3\u7801\u4f7f\u7528\u201c\u7ec8\u7aef\u201d\u9762\u677f\u6216\u201c\u8fd0\u884c\u8c03\u8bd5\u201d\u8fd0\u884c\u4ee3\u7801\n<\/p><\/blockquote>\n<p><img decoding=\"async\" src=\"https:\/\/img.php.cn\/upload\/article\/202405\/27\/2024052711571967054.jpg\" class=\"aligncenter\" title=\"vscode\u600e\u4e48\u8fd0\u884cnodejs\u63d2\u56fe\" alt=\"vscode\u600e\u4e48\u8fd0\u884cnodejs\u63d2\u56fe\" \/><\/p>\n<p><strong>\u5982\u4f55\u4f7f\u7528 Visual Studio Code \u8fd0\u884c Node.js<\/strong><\/p>\n<p>\u4f7f\u7528 Visual Studio Code (VS Code) \u8fd0\u884c Node.js \u975e\u5e38\u7b80\u5355\uff0c\u53ea\u9700\u4ee5\u4e0b\u51e0\u4e2a\u6b65\u9aa4\uff1a<\/p>\n<p><strong>1. \u5b89\u88c5 Node.js<\/strong><\/p>\n<p>\u9996\u5148\uff0c\u4f60\u9700\u8981\u5728\u8ba1\u7b97\u673a\u4e0a\u5b89\u88c5 Node.js\uff0c\u8bf7\u8bbf\u95ee Node.js \u5b98\u65b9\u7f51\u7ad9\u4e0b\u8f7d\u5e76\u5b89\u88c5\u6700\u65b0\u7248\u672c\u3002<\/p>\n<p><strong>2. \u6253\u5f00 VS Code<\/strong><\/p>\n<p>\u5b89\u88c5 Node.js \u540e\uff0c\u6253\u5f00 VS Code\u3002<\/p>\n<p><strong>3. \u914d\u7f6e VS Code<\/strong><\/p>\n<p>\u8981\u914d\u7f6e VS Code \u4ee5\u652f\u6301 Node.js\uff0c\u8bf7\u6309\u7167\u4ee5\u4e0b\u6b65\u9aa4\u64cd\u4f5c\uff1a<\/p>\n<ul>\n<li>\u5355\u51fb\u201c\u6587\u4ef6\u201d&gt;\u201c\u9996\u9009\u9879\u201d&gt;\u201c\u8bbe\u7f6e\u201d\u3002<\/li>\n<li>\u5728\u641c\u7d22\u680f\u4e2d\u8f93\u5165 &#8220;&#8221;\u3002<\/li>\n<li>\u786e\u4fdd\u9009\u4e2d\u201cNode.js: Use VS Code built-in JavaScript language features\u201d \u590d\u9009\u6846\u3002<\/li>\n<\/ul>\n<p><strong>4. \u521b\u5efa Node.js \u6587\u4ef6<\/strong><\/p>\n<p>\u5728 VS Code \u4e2d\u521b\u5efa\u4e00\u4e2a\u65b0\u7684\u6587\u4ef6\uff0c\u7136\u540e\u5c06\u6587\u4ef6\u6269\u5c55\u540d\u4fdd\u5b58\u4e3a &#8220;.js&#8221;\u3002\u4f8b\u5982\uff0c\u4f60\u53ef\u4ee5\u521b\u5efa\u540d\u4e3a &#8220;hello.js&#8221; \u7684\u6587\u4ef6\u3002<\/p>\n<p><strong>5. \u7f16\u5199 Node.js \u4ee3\u7801<\/strong><\/p>\n<p>\u5728 &#8220;hello.js&#8221; \u6587\u4ef6\u4e2d\uff0c\u8f93\u5165\u4ee5\u4e0b\u4ee3\u7801\uff1a<\/p>\n<pre>console.log(\"Hello, world!\");<\/pre>\n<p> \u767b\u5f55\u540e\u590d\u5236 <\/p>\n<p><strong>6. \u8fd0\u884c Node.js \u4ee3\u7801<\/strong><\/p>\n<p>\u6709\u4e24\u79cd\u65b9\u6cd5\u53ef\u4ee5\u5728 VS Code \u4e2d\u8fd0\u884c Node.js \u4ee3\u7801\uff1a<\/p>\n<ul>\n<li> <strong>\u4f7f\u7528\u201c\u7ec8\u7aef\u201d\u9762\u677f\uff1a<\/strong>\u6253\u5f00\u201c\u7ec8\u7aef\u201d\u9762\u677f\uff08\u201c\u89c6\u56fe\u201d&gt;\u201c\u7ec8\u7aef\u201d\uff09\uff0c\u7136\u540e\u8f93\u5165\u4ee5\u4e0b\u547d\u4ee4\uff1a<\/li>\n<\/ul>\n<pre>node hello.js<\/pre>\n<p> \u767b\u5f55\u540e\u590d\u5236 <\/p>\n<ul>\n<li> <strong>\u4f7f\u7528\u8fd0\u884c\u8c03\u8bd5\uff1a<\/strong>\u8f6c\u5230\u201c\u8c03\u8bd5\u201d\u9009\u9879\u5361\uff08\u201c\u89c6\u56fe\u201d&gt;\u201c\u8c03\u8bd5\u201d\uff09\uff0c\u7136\u540e\u5355\u51fb\u7eff\u8272\u4e09\u89d2\u5f62\u6309\u94ae\uff08\u8fd0\u884c\u6309\u94ae\uff09\u3002<\/li>\n<\/ul>\n<p>\u8fd9\u5c06\u8fd0\u884c Node.js \u4ee3\u7801\u5e76\u8f93\u51fa\u7ed3\u679c &#8220;Hello, world!&#8221;\u3002<\/p>\n<p>\u4ee5\u4e0a\u5c31\u662f\u600e\u4e48\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>\u53ef\u4ee5\u4f7f\u7528 visual studio code (vs code) \u8fd0\u884c node.js \u4ee3\u7801\uff0c\u6b65\u9aa4\u5305\u542b\uff1a\u5b89\u88c5 node.js\u6253\u5f00 vs code\u914d\u7f6e vs code \u4ee5\u652f\u6301 node.js\u521b\u5efa node.js \u6587\u4ef6\u7f16\u5199 node.js \u4ee3\u7801\u4f7f\u7528\u201c\u7ec8\u7aef\u201d\u9762\u677f\u6216\u201c\u8fd0\u884c\u8c03\u8bd5\u201d\u8fd0\u884c\u4ee3\u7801 \u5982\u4f55\u4f7f\u7528 Visual Studio Code \u8fd0\u884c Node.js \u4f7f\u7528 Visual Studio Code (VS Code) \u8fd0\u884c Node.js \u975e\u5e38\u7b80\u5355\uff0c\u53ea\u9700\u4ee5\u4e0b\u51e0\u4e2a\u6b65\u9aa4\uff1a 1. \u5b89\u88c5 Node.js \u9996\u5148\uff0c\u4f60\u9700\u8981\u5728\u8ba1\u7b97\u673a\u4e0a\u5b89\u88c5 Node.js\uff0c\u8bf7\u8bbf\u95ee Node.js \u5b98\u65b9\u7f51\u7ad9\u4e0b\u8f7d\u5e76\u5b89\u88c5\u6700\u65b0\u7248\u672c\u3002 2. \u6253\u5f00 VS Code \u5b89\u88c5 Node.js \u540e\uff0c\u6253\u5f00 VS Code\u3002 3. \u914d\u7f6e VS Code [&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-21358","post","type-post","status-publish","format-standard","hentry","category-16"],"_links":{"self":[{"href":"https:\/\/fwq.ai\/blog\/wp-json\/wp\/v2\/posts\/21358","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=21358"}],"version-history":[{"count":0,"href":"https:\/\/fwq.ai\/blog\/wp-json\/wp\/v2\/posts\/21358\/revisions"}],"wp:attachment":[{"href":"https:\/\/fwq.ai\/blog\/wp-json\/wp\/v2\/media?parent=21358"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/fwq.ai\/blog\/wp-json\/wp\/v2\/categories?post=21358"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/fwq.ai\/blog\/wp-json\/wp\/v2\/tags?post=21358"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}