\u7cfb\u7edf<\/a>\u7a33\u5b9a\uff0c\u656c\u8bf7\u5c06$PATH\u73af\u5883\u53d8\u91cf\u66f4\u6539\u4e3a\uff1a\"\/opt\/node-v14.17.0-linux-x64\/bin\"+\u539f\u6709\u8def\u5f84\u3002<\/p>\n\u6267\u884c\u4ee5\u4e0b\u547d\u4ee4\u4f7f\u914d\u7f6e\u751f\u6548\uff1a<\/p>\n
source ~\/.bashrc<\/p>\n
\u56db\u3001\u5982\u4f55\u9a8c\u8bc1Node.js\u662f\u5426\u5b89\u88c5\u6210\u529f\uff1f<\/b><\/p>\n
1.\u6253\u5f00\u7ec8\u7aef\uff0c\u8f93\u5165\u4ee5\u4e0b\u547d\u4ee4\u67e5\u770bNode.js\u7248\u672c\uff1a<\/p>\n
node -v<\/p>\n
\u5982\u679c\u6210\u529f\u5b89\u88c5\uff0c\u5c06\u663e\u793a\u5b89\u88c5\u7684Node.js\u7248\u672c\u53f7\u3002<\/p>\n
2.\u8f93\u5165\u4ee5\u4e0b\u547d\u4ee4\u67e5\u770bnpm\uff08Node\u5305\u7ba1\u7406\u5668\uff09\u7248\u672c\uff1a<\/p>\n
npm -v<\/p>\n
\u5982\u679c\u6210\u529f\u5b89\u88c5\uff0c\u5c06\u663e\u793a\u5b89\u88c5\u7684npm\u7248\u672c\u53f7\u3002<\/p>\n
\u4e94\u3001\u5982\u4f55\u5347\u7ea7Node.js\uff1f<\/b><\/p>\n
1.\u9996\u5148\uff0c\u5378\u8f7d\u65e7\u7248\u672c\u7684Node.js\uff1a<\/p>\n
\u6253\u5f00\u7ec8\u7aef\uff0c\u8f93\u5165\u4ee5\u4e0b\u547d\u4ee4\uff1a<\/p>\n
\u5c0a\u656c\u7684\u7528\u6237linux\u4fee\u6539\u6587\u4ef6\u540d\uff0c\u5982\u60a8\u9700\u8981\u5220\u9664\/opt\/node-v14.17.0-linux-x64\u76ee\u5f55\u4e2d\u7684\u6240\u6709\u6587\u4ef6\uff0c\u53ef\u8bd5\u7740\u8fd0\u884c\u4e0b\u8ff0\u6307\u4ee4\uff1a\".\/sudo rm -Rf \/opt\/node-v14.17.0-linux-x64\/\"\u3002\u6b64\u64cd\u4f5c\u5c06\u786e\u4fdd\u60a8\u6570\u636e\u7684\u5b89\u5168\u65e0\u865e\u3002<\/p>\n
2.\u7136\u540e\uff0c\u6309\u7167\u4e0a\u8ff0\u6b65\u9aa4\u91cd\u65b0\u5b89\u88c5\u6700\u65b0\u7248\u7684Node.js\u3002<\/p>\n
\u516d\u3001\u5982\u4f55\u5378\u8f7dNode.js\uff1f<\/b><\/p>\n
1.\u6253\u5f00\u7ec8\u7aef\uff0c\u8f93\u5165\u4ee5\u4e0b\u547d\u4ee4\u5378\u8f7dNode.js\uff1a<\/p>\n
2.\u7f16\u8f91.bashrc\u6587\u4ef6\uff0c\u5220\u9664\u4e4b\u524d\u914d\u7f6e\u7684\u73af\u5883\u53d8\u91cf\uff1a<\/p>\n
\u5220\u9664\u4ee5\u4e0b\u5185\u5bb9\u5e76\u4fdd\u5b58\uff1a<\/p>\n
\u4e03\u3001\u5982\u4f55\u4f7f\u7528\u6dd8\u5b9d\u955c\u50cf\u63d0\u9ad8npm\u4e0b\u8f7d\u901f\u5ea6\uff1f<\/b><\/p>\n
1.\u6253\u5f00\u7ec8\u7aeflinux nodejs\u5b89\u88c5<\/strong>\uff0c\u8f93\u5165\u4ee5\u4e0b\u547d\u4ee4\u914d\u7f6e\u6dd8\u5b9d\u955c\u50cf\uff1a<\/p>\n\u63d0\u9192\u60a8\u8bf7\u81ea\u89c9\u5c06npm\u4f9d\u8d56\u5e93\u6307\u5411\uff0c\u611f\u8c22\u60a8\u7684\u914d\u5408\uff01<\/p>\n
2.\u9a8c\u8bc1\u662f\u5426\u914d\u7f6e\u6210\u529f\uff1a<\/p>\n
\u8f93\u5165\u4ee5\u4e0b\u547d\u4ee4\u67e5\u770bnpm\u955c\u50cf\u5730\u5740\uff1a<\/p>\n
npm config get registry<\/p>\n
\u82e5\u662f\u770b\u5230\u8fd9\u6837\u7684\u94fe\u63a5\uff0c\u771f\u4e3a\u60a8\u9ad8\u5174\uff01\u8bc1\u660e\u5df2\u6210\u529f\u5b8c\u6210\u914d\u7f6e\u8fc7\u7a0b\u3002<\/p>\n
\u516b\u3001\u5982\u4f55\u5b89\u88c5\u5168\u5c40\u6a21\u5757\uff1f<\/b><\/p>\n
1.\u6253\u5f00\u7ec8\u7aef\uff0c\u8f93\u5165\u4ee5\u4e0b\u547d\u4ee4\u5b89\u88c5\u5168\u5c40\u6a21\u5757\uff1a<\/p>\n
npm install -g\u6a21\u5757\u540d<\/p>\n
\u5176\u4e2d\uff0c\u6a21\u5757\u540d\u4e3a\u9700\u8981\u5b89\u88c5\u7684\u5168\u5c40\u6a21\u5757\u540d\u79f0\u3002<\/p>\n
2.\u5b89\u88c5\u5b8c\u6210\u540elinux nodejs\u5b89\u88c5<\/strong>\uff0c\u53ef\u4ee5\u5728\u4efb\u610f\u76ee\u5f55\u4e0b\u4f7f\u7528\u8be5\u5168\u5c40\u6a21\u5757\u3002<\/p>\n\u4e5d\u3001\u5982\u4f55\u5b89\u88c5\u9879\u76ee\u4f9d\u8d56\uff1f<\/b><\/p>\n
1.\u6253\u5f00\u7ec8\u7aef\uff0c\u8fdb\u5165\u9879\u76ee\u6839\u76ee\u5f55\u3002<\/p>\n
2.\u8f93\u5165\u4ee5\u4e0b\u547d\u4ee4\u5b89\u88c5\u9879\u76ee\u4f9d\u8d56\uff1a<\/p>\n
npm install<\/p>\n
Node.js\u5c06\u81ea\u52a8\u4e0b\u8f7d\u5e76\u5b89\u88c5\u9879\u76ee\u6240\u9700\u7684\u6240\u6709\u4f9d\u8d56\u3002<\/p>\n
\u5341\u3001\u5982\u4f55\u66f4\u65b0\u9879\u76ee\u4f9d\u8d56\uff1f<\/b><\/p>\n
2.\u8f93\u5165\u4ee5\u4e0b\u547d\u4ee4\u66f4\u65b0\u9879\u76ee\u4f9d\u8d56\uff1a<\/p>\n
npm update<\/p>\n
Node.js\u5c06\u81ea\u52a8\u68c0\u67e5\u5e76\u66f4\u65b0\u9879\u76ee\u6240\u9700\u7684\u4f9d\u8d56\u3002<\/p>\n
\u6b64\u7bc7\u6559\u7a0b\u5c06\u4e3a\u60a8\u4ecb\u7ecd\u5982\u4f55\u4fbf\u6377\u5730\u5728Linux\u73af\u5883\u4e0b\u5b89\u88c5\u5e76\u8fd0\u7528Node.js\u3002\u613f\u60a8\u5728\u6b64\u5b66\u4e60\u548c\u5b9e\u8df5Node.js\u7684\u65c5\u9014\u4e2d\u6536\u83b7\u6ee1\u6ee1\uff0c\u6109\u5feb\u65e0\u9650\uff01<\/p>\n","protected":false},"excerpt":{"rendered":"
js\u52a9\u60a8\u8f7b\u677e\u5f00\u53d1\u5404\u7c7b\u5e94\u7528\uff0c\u4f8b\u5982Web\u670d\u52a1\u5668\u6216\u547d\u4ee4\u884c\u5de5\u5177\u54e6\uff01\u8f93\u5165\u4ee5\u4e0b\u547d\u4ee4\u67e5\u770bnpm\uff08Node\u5305\u7ba1\u7406\u5668\uff09\u7248\u672c\uff1a\u5982\u679c\u6210\u529f\u5b89\u88c5\uff0c\u5c06\u663e\u793a\u5b89\u88c5\u7684npm\u7248\u672c\u53f7\u3002\u4e03\u3001\u5982\u4f55\u4f7f\u7528\u6dd8\u5b9d\u955c\u50cf\u63d0\u9ad8npm\u4e0b\u8f7d\u901f\u5ea6\uff1fjs\u5c06\u81ea\u52a8\u4e0b\u8f7d\u5e76\u5b89\u88c5\u9879\u76ee\u6240\u9700\u7684\u6240\u6709\u4f9d\u8d56\u3002\u6b64\u7bc7\u6559\u7a0b\u5c06\u4e3a\u60a8\u4ecb\u7ecd\u5982\u4f55\u4fbf\u6377\u5730\u5728Linux\u73af\u5883\u4e0b\u5b89\u88c5\u5e76\u8fd0\u7528Node.<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"_acf_changed":false,"footnotes":""},"categories":[988],"tags":[999],"class_list":["post-288938","post","type-post","status-publish","format-standard","hentry","category-tougao","tag-999"],"acf":[],"_links":{"self":[{"href":"https:\/\/lrxjmw.cn\/wp-json\/wp\/v2\/posts\/288938","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=288938"}],"version-history":[{"count":0,"href":"https:\/\/lrxjmw.cn\/wp-json\/wp\/v2\/posts\/288938\/revisions"}],"wp:attachment":[{"href":"https:\/\/lrxjmw.cn\/wp-json\/wp\/v2\/media?parent=288938"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/lrxjmw.cn\/wp-json\/wp\/v2\/categories?post=288938"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/lrxjmw.cn\/wp-json\/wp\/v2\/tags?post=288938"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}