{"id":290402,"date":"2024-03-17T21:31:49","date_gmt":"2024-03-17T13:31:49","guid":{"rendered":"https:\/\/lrxjmw.cn\/nazgfyvdsfyn.html"},"modified":"2024-03-17T21:31:49","modified_gmt":"2024-03-17T13:31:49","slug":"nazgfyvdsfyn","status":"publish","type":"post","link":"https:\/\/lrxjmw.cn\/nazgfyvdsfyn.html","title":{"rendered":"Node.js\u5b89\u88c5\uff1a\u5b98\u65b9\u6e90VS\u7b2c\u4e09\u65b9\u6e90\uff0c\u54ea\u4e2a\u66f4\u9999\uff1f"},"content":{"rendered":"

\u672c\u6587\u5c31\u4f7f\u7528YUM\u8f6f\u4ef6\u5305\u7ba1\u7406\u5668\u8fdb\u884cNode.js\u52a0\u8f7d\u6240\u6d89\u53ca\u7684\u4e24\u4e2a\u9014\u5f84\uff0c\u5305\u62ec\u76f4\u63a5\u8fde\u63a5\u5b98\u65b9\u670d\u52a1\u5668\u548c\u501f\u52a9\u7b2c\u4e09\u65b9\u8f6c\u53d1\u670d\u52a1\u5668linux\u8bbe\u7f6e\u73af\u5883\u53d8\u91cf\uff0c\u5c55\u5f00\u4e86\u6df1\u5ea6\u63a2\u8ba8linux yum\u5b89\u88c5<\/a>nodejs<\/strong>\uff0c\u540c\u65f6\u6bd4\u8f83\u4e86\u5b83\u4eec\u5404\u81ea\u7684\u4f18\u70b9\u4e0e\u4e0d\u8db3\u4e4b\u5904\u3002<\/p>\n

\u4e00\u3001\u4f7f\u7528\u5b98\u65b9\u6e90\u5b89\u88c5node.js<\/b><\/p>\n

\u5fc5\u987b\u5148\u5b89\u88c5EPEL\u5e93\u53caNode.js\u8f6f\u4ef6\u5305\uff0c\u7136\u540e\u8fdb\u884c\u9002\u5f53\u914d\u7f6e\u4e0e\u68c0\u67e5\u3002<\/p>\n

-\u4eae\u70b9:\u6302\u63a5\u5b98\u65b9\u6700\u65b0\u6cd5\u6e90\u53d1\u5e03\u4fe1\u606f\uff0cNode.js\u65b0\u7248\u7a33\u5b9a\u9ad8\u6548\u8fd0\u884c\u4fdd\u969c\u3002<\/p>\n

-\u7f3a\u70b9\uff1a\u5b89\u88c5\u8fc7\u7a0b\u7a0d\u663e\u7e41\u7410\uff0c\u9700\u8981\u624b\u52a8\u6dfb\u52a0\u6e90\u548c\u9a8c\u8bc1\u5bc6\u94a5\u3002<\/p>\n

\u4e8c\u3001\u4f7f\u7528\u7b2c\u4e09\u65b9\u6e90\u5b89\u88c5node.js<\/b><\/p>\n

\u5b9e\u65bd\u6307\u5357\uff1a\u501f\u52a9nvm\uff08Node Version Manager\uff09\u5b9e\u73b0\u7cbe\u786e\u7ba1\u7406Node.js\u7248\u672c\uff1b\u5176\u6b21\uff0c\u4ece\u7b2c\u4e09\u65b9\u8d44\u6e90\u63d0\u53d6\u60a8\u6240\u9700\u7684\u5bf9\u5e94\u7248\u672c\u3002<\/p>\n

-\u7279\u6027\uff1aNVM\u63d0\u4f9b\u9ad8\u6548\u4fbf\u6377\u7684\u7248\u672c\u914d\u7f6e\u7ba1\u7406\u670d\u52a1\uff0c\u652f\u6301\u5feb\u901f\u5207\u6362\u81f3\u6240\u9700\u7684Node.js\u7248\u672c\u3002<\/p>\n

-\u7f3a\u70b9\uff1a\u7b2c\u4e09\u65b9\u6e90\u53ef\u80fd\u66f4\u65b0\u4e0d\u53ca\u65f6\uff0c\u5b58\u5728\u4e00\u5b9a\u7684\u98ce\u9669\u3002<\/p>\n

\u4e09\u3001\u5bf9\u6bd4\u4e0e\u603b\u7ed3<\/b><\/p>\n

-\u5b89\u88c5\u901f\u5ea6\uff1a\u5b98\u65b9\u6e90\u76f8\u5bf9\u8f83\u6162\uff0c\u800c\u7b2c\u4e09\u65b9\u6e90\u4e0b\u8f7d\u901f\u5ea6\u8f83\u5feb\u3002<\/p>\n

\u2014\u2014\u65f6\u523b\u5b88\u5019\u6700\u65b0\u7248\u672c\uff1a\u5b98\u7f51\u5b9e\u65f6\u53d1\u5e03Node.js\u65b0\u7248\u52a8\u6001\uff0c\u52a9\u4f60\u7d27\u968f\u524d\u6cbf\u79d1\u6280\u53d1\u5c55\u6b65\u4f10\uff1b\u6709\u522b\u4e8e\u5e02\u573a\u4e0a\u4f17\u591a\u7b2c\u4e09\u65b9\uff0c\u6211\u4eec\u514d\u53bb\u56e0\u4fe1\u606f\u5ef6\u8bef\u5e26\u6765\u7684\u56f0\u6270\u3002<\/p>\n

\u5b89\u88c5\u5fae\u4fe1_\u5b89\u88c5\u5305_linux yum\u5b89\u88c5nodejs<\/p>\n

-\u7a33\u56fa\u6027\u4e0e\u5b89\u5168\u6027\uff1a\u5c3d\u7ba1\u4f18\u5148\u8003\u91cf\u5b98\u65b9\u8d44\u6e90\u7684\u53ef\u9760\u6027\uff0c\u4f46\u7b2c\u4e09\u65b9\u4fe1\u606f\u6765\u6e90\u4e5f\u9700\u8b66\u60d5\u5176\u6f5c\u5728\u5a01\u80c1\u3002<\/p>\n

\u6df1\u5316\u5256\u6790\uff1a\u76f8\u8f83\u4e8e\u7e41\u7410\u8d39\u65f6\u7684\u5b98\u65b9\u8d44\u6e90\u914d\u7f6e\uff0c\u7531NVM\u6280\u672f\u52a9\u529b\u7684\u7b2c\u4e09\u65b9\u8d44\u6e90\u5728\u6548\u80fd\u65b9\u9762\u5177\u6709\u5de8\u5927\u4f18\u52bf\u3002<\/p>\n

\u56db\u3001\u5b9e\u4f8b\u5206\u6790<\/b><\/p>\n

-\u5b89\u88c5\u5b98\u65b9\u6e90\uff1a\u6267\u884c\u4ee5\u4e0b\u547d\u4ee4<\/a><\/p>\n

sudo yum install epel-release<\/p>\n

sudo yum install nodejs<\/p>\n

-\u5b89\u88c5\u7b2c\u4e09\u65b9\u6e90\uff1a\u6267\u884c\u4ee5\u4e0b\u547d\u4ee4<\/p>\n

\u5728\u8fd9\u4e00\u6b65\u9aa4\u4e2d\uff0c\u6211\u4eec\u4f1a\u8fd0\u7528\"curl\"\u5b9e\u7528\u7a0b\u5e8f\uff0c\u83b7\u53d6https\u534f\u8bae\u4e0b\u7684\u6587\u4ef6\u7684\u5185\u5bb9\uff0c\u7136\u540e\u5c06\u5176\u4e0b\u8f7d\u81f3\u672c\u5730\u4e3b\u673a\u3002\u63a5\u7740\uff0c\u901a\u8fc7\u5feb\u6377\u952e\u6307\u4ee4\"bash\"\uff0c\u5373\u53ef\u542f\u52a8\u6211\u4eec\u4e0b\u8f7d\u7684\u5b89\u88c5\u7a0b\u5e8f\u3002<\/p>\n

source ~\/.bashrc<\/p>\n

nvm install node<\/p>\n

\u4e94\u3001\u6ce8\u610f\u4e8b\u9879<\/b><\/p>\n

-\u8fd0\u7528\u7b2c\u4e09\u65b9\u8d44\u6e90\u9700\u614e\u91cd\u9a8c\u8bc1\u5176\u53ef\u4fe1\u5ea6\uff0c\u9632\u6b62\u6076\u610f\u8f6f\u4ef6\u4fb5\u5165\u3002<\/p>\n

\u5728\u8fdb\u884c\u5b89\u88c5\u8fc7\u7a0b\u4e2d\uff0c\u5b58\u5728\u4f9d\u8d56\u6027\u95ee\u9898\uff0c\u9700\u6839\u636e\u5177\u4f53\u60c5\u51b5\u8c03\u6574\u65b9\u6848\u3002<\/p>\n

\u516d\u3001\u603b\u7ed3\u4e0e\u5efa\u8bae<\/b><\/p>\n

\u9274\u4e8e\u5bf9\u4e8e\u5feb\u901f\u548c\u7b80\u4fbf\u7684\u7cfb\u7edf<\/a>\u5b89\u88c5\u4ee5\u53ca\u6700\u65b0\u7248\u672c\u66f4\u65b0\u4e4b\u9700\u8981linux yum\u5b89\u88c5nodejs<\/strong>\uff0c\u6211\u4eec\u5f3a\u70c8\u63a8\u8350\u60a8\u4ece\u5b98\u65b9\u6e20\u9053\u8fdb\u884c\u6388\u6743\u83b7\u5f97\u5e76\u5b9e\u73b0\u5b89\u88c5\u3002<\/p>\n

linux yum\u5b89\u88c5nodejs_\u5b89\u88c5\u5fae\u4fe1_\u5b89\u88c5\u5305<\/p>\n

\u8003\u8651\u4f7f\u7528\u7b2c\u4e09\u65b9\u8d44\u6e90\u4ee5\u63d0\u9ad8Node.js\u7684\u591a\u7248\u672c\u5207\u6362\u4e0e\u5b89\u88c5\u6548\u7387\u3002<\/p>\n

\u4e03\u3001\u4e2a\u4eba\u7ecf\u9a8c\u5206\u4eab<\/b><\/p>\n

\u8eab\u4e3a\u8d44\u6df1\u7814\u53d1\u4e13\u5bb6linux\u7cfb\u7edf\u600e\u4e48\u6837\uff0c\u6211\u66f4\u504f\u5411\u9009\u7528\u5b98\u65b9\u6e90\u5b89\u88c5\u9879\u76ee\u3002\u867d\u7136\u6b65\u9aa4\u8f83\u4e3a\u7e41\u590d\uff0c\u7136\u800c\u5b83\u5728\u6027\u80fd\u8868\u73b0\u4e0a\u5177\u6709\u7a33\u5b9a\u6027\u5f3a\u3001\u6548\u7387\u4f18\u5f02\u53ca\u6700\u65b0\u7248\u652f\u6301\u5ea6\u9ad8\u7b49\u663e\u8457\u7279\u70b9\uff0c\u8fd9\u5bf9\u4e8e\u7814\u53d1\u5de5\u4f5c\u5177\u6709\u81f3\u5173\u91cd\u8981\u7684\u76ca\u5904\u3002<\/p>\n

\u516b\u3001\u53c2\u8003\u8d44\u6599<\/b><\/p>\n

\u8bf7\u60a8\u8be6\u7ec6\u67e5\u9605\u5b98\u65b9\u6587\u6863\uff1a<\/p>\n

\u672c\u5b98\u7f51\u94fe\u63a5\u8bf7\u89c1\uff1a\u3002<\/p>\n","protected":false},"excerpt":{"rendered":"

\u672c\u6587\u5c31\u4f7f\u7528YUM\u8f6f\u4ef6\u5305\u7ba1\u7406\u5668\u8fdb\u884cNode.\u4e00\u3001\u4f7f\u7528\u5b98\u65b9\u6e90\u5b89\u88c5node.js\u8f6f\u4ef6\u5305\uff0c\u7136\u540e\u8fdb\u884c\u9002\u5f53\u914d\u7f6e\u4e0e\u68c0\u67e5\u3002\u4e8c\u3001\u4f7f\u7528\u7b2c\u4e09\u65b9\u6e90\u5b89\u88c5node.js\u7248\u672c\uff1b\u5176\u6b21\uff0c\u4ece\u7b2c\u4e09\u65b9\u8d44\u6e90\u63d0\u53d6\u60a8\u6240\u9700\u7684\u5bf9\u5e94\u7248\u672c\u3002-\u5b89\u88c5\u901f\u5ea6\uff1a\u5b98\u65b9\u6e90\u76f8\u5bf9\u8f83\u6162\uff0c\u800c\u7b2c\u4e09\u65b9\u6e90\u4e0b\u8f7d\u901f\u5ea6\u8f83\u5feb\u3002-\u5b89\u88c5\u5b98\u65b9\u6e90\uff1a\u6267\u884c\u4ee5\u4e0b\u547d\u4ee4<\/p>\n","protected":false},"author":1,"featured_media":290403,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"_acf_changed":false,"footnotes":""},"categories":[988],"tags":[999],"class_list":["post-290402","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-tougao","tag-999"],"acf":[],"_links":{"self":[{"href":"https:\/\/lrxjmw.cn\/wp-json\/wp\/v2\/posts\/290402","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/lrxjmw.cn\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/lrxjmw.cn\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/lrxjmw.cn\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/lrxjmw.cn\/wp-json\/wp\/v2\/comments?post=290402"}],"version-history":[{"count":0,"href":"https:\/\/lrxjmw.cn\/wp-json\/wp\/v2\/posts\/290402\/revisions"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/lrxjmw.cn\/wp-json\/wp\/v2\/media\/290403"}],"wp:attachment":[{"href":"https:\/\/lrxjmw.cn\/wp-json\/wp\/v2\/media?parent=290402"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/lrxjmw.cn\/wp-json\/wp\/v2\/categories?post=290402"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/lrxjmw.cn\/wp-json\/wp\/v2\/tags?post=290402"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}