{"id":46318,"date":"2025-07-30T02:51:49","date_gmt":"2025-07-29T18:51:49","guid":{"rendered":"https:\/\/www.wsisp.com\/helps\/46318.html"},"modified":"2025-07-30T02:51:49","modified_gmt":"2025-07-29T18:51:49","slug":"nvm-%e5%ae%89%e8%a3%85-nodejs%e7%8e%af%e5%a2%83%ef%bc%8c%e4%bb%a5%e5%8f%8a-pnpm-%e7%9a%84%e5%ae%89%e8%a3%85-%e4%b8%80%e6%ad%a5%e4%b8%80%e6%ad%a5%e9%85%8d%e7%bd%ae-ubuntu-server","status":"publish","type":"post","link":"https:\/\/www.wsisp.com\/helps\/46318.html","title":{"rendered":"NVM \u5b89\u88c5 NodeJS\u73af\u5883\uff0c\u4ee5\u53ca PNPM \u7684\u5b89\u88c5 \u2014\u2014 \u4e00\u6b65\u4e00\u6b65\u914d\u7f6e Ubuntu Server \u7684 NodeJS \u670d\u52a1\u5668\u8be6\u7ec6\u5b9e\u5f55 5"},"content":{"rendered":"<h3>\u524d\u8a00<\/h3>\n<p>\u5199\u6587\u7ae0\u5199\u5f97\u624b\u75bc\u4e86&#xff0c;\u5927\u5bb6\u591a\u591a\u5173\u6ce8\u70b9\u8d5e\u6536\u85cf\u8bc4\u8bba\u554a&#xff01;\u901a\u8fc7\u524d\u9762\u51e0\u7bc7\u6587\u7ae0&#xff0c;\u6211\u4eec\u987a\u5229\u7684 \u5b89\u88c5\u4e86 ubuntu server \u670d\u52a1\u5668&#xff0c;\u5e76\u4e14\u914d\u7f6e\u597d\u4e86 ssh \u514d\u5bc6\u767b\u5f55\u670d\u52a1\u5668&#xff0c;\u5b89\u88c5\u597d\u4e86 \u670d\u52a1\u5668\u5e38\u7528\u8f6f\u4ef6\u5b89\u88c5, \u5e76\u4e14 \u914d\u7f6e\u597d\u4e86 zsh \u548c vim \u63a5\u4e0b\u6765&#xff0c;\u6211\u4eec\u5c31\u8981\u914d\u7f6e\u6211\u4eec\u7684\u670d\u52a1\u73af\u5883\u4e86\u3002\u4f5c\u4e3a\u4e00\u53f0\u670d\u52a1\u5668&#xff0c;\u5982\u679c\u5b83\u4e0d\u63d0\u4f9b\u670d\u52a1&#xff0c;\u90a3\u5b83\u5e72\u4e86\u4e2a\u5565\u5bf9\u5427\u3002\u3002\u3002<\/p>\n<p>\u4f5c\u4e3a NodeJS \u7684\u670d\u52a1\u5668&#xff0c;\u9996\u5148\u8981\u505a\u7684\u5c31\u662f\u5b89\u88c5 NodeJS&#xff0c;\u4f46\u662f&#xff0c;\u6211\u4eec\u4e5f\u77e5\u9053&#xff0c;\u4ee5\u6211\u4eec\u524d\u7aef\u65e5\u65b0\u6708\u5f02\u7684\u53d1\u5c55\u901f\u5ea6&#xff0c;\u4eca\u5929\u4f60\u7684\u4ee3\u7801\u8fd8\u662f\u8dd1\u5f97\u8d3c\u6b22\u5531&#xff0c;\u8fc7\u4e24\u5929&#xff0c; NodeJS \u7248\u672c\u4e00\u5347\u7ea7&#xff0c;\u53ef\u80fd\u5c31\u6302\u4e86\u3002<\/p>\n<p>\u90a3\u4e48&#xff0c;\u4f5c\u4e3a\u670d\u52a1\u5668&#xff0c;\u80af\u5b9a\u4e0d\u80fd\u53ea\u8fd0\u884c\u4e00\u4e2a\u7248\u672c\u7684 Node&#xff0c;\u4e5f\u56e0\u6b64&#xff0c;\u6211\u4eec\u5c31\u9700\u8981 Node \u7248\u672c\u7ba1\u7406\u5668\u3002<\/p>\n<p>\u76ee\u524d&#xff0c;\u6211\u4e2a\u4eba\u63a8\u8350 nvm \u4f5c\u4e3a\u6211\u4eec\u7684 Node \u7248\u672c\u7ba1\u7406\u5668\u3002<\/p>\n<h3>\u5b89\u88c5 NVM<\/h3>\n<p>\u4f5c\u4e3a Node \u7248\u672c\u7ba1\u7406\u5668&#xff0c;\u662f\u6709\u4f17\u591a\u7684\u9009\u62e9\u7684\u3002<\/p>\n<p><img decoding=\"async\" src=\"https:\/\/www.wsisp.com\/helps\/wp-content\/uploads\/2025\/07\/20250729185146-6889184241274.png\" alt=\"node \u7248\u672c\u7ba1\u7406\u5668\u5bf9\u6bd4\" \/> \u4f46\u662f&#xff0c;\u6700\u88ab\u5e7f\u6cdb\u4f7f\u7528\u548c\u63a5\u53d7\u7684&#xff0c;\u5c31\u662f NVM \u4e86\u3002<\/p>\n<p>nvm \u5b98\u65b9\u7f51\u7ad9\u4ee5\u53ca\u4ed3\u5e93 https:\/\/github.com\/nvm-sh\/nvm<\/p>\n<p><span class=\"token function\">curl<\/span> -o- https:\/\/raw.githubusercontent.com\/nvm-sh\/nvm\/v0.40.3\/install.sh <span class=\"token operator\">|<\/span> <span class=\"token function\">bash<\/span><\/p>\n<p>\u4e0a\u9762\u662f\u5b89\u88c5\u547d\u4ee4&#xff0c;\u6211\u4eec\u5728\u670d\u52a1\u5668\u4e0a\u8fd0\u884c&#xff0c;\u8fd0\u884c\u7ed3\u679c\u5982\u4e0b&#xff1a;<\/p>\n<p><img decoding=\"async\" src=\"https:\/\/www.wsisp.com\/helps\/wp-content\/uploads\/2025\/07\/20250729185147-6889184311a65.png\" alt=\"\u5b89\u88c5 nvm\" \/> \u6211\u5b89\u88c5\u4e4b\u540e&#xff0c;\u8f93\u5165 nvm -v \u67e5\u770b\u662f\u5426\u5b89\u88c5\u5b8c\u6210&#xff0c;\u7ed3\u679c\u544a\u8bc9\u6211\u6ca1\u6709\u627e\u5230\u547d\u4ee4\u3002<\/p>\n<p>\u4e8e\u662f&#xff0c;\u6211\u67e5\u770b\u4e86\u4e00\u4e0b .zshrc \u6587\u4ef6&#xff0c;\u770b\u4e0a\u56fe\u4e2d\u63d0\u793a\u9700\u8981\u6dfb\u52a0\u7684\u4ee3\u7801&#xff0c;\u6709\u6ca1\u6709\u6dfb\u52a0\u5230\u914d\u7f6e\u6587\u4ef6\u4e2d&#xff0c;\u770b\u4e86\u4e00\u4e0b&#xff0c;\u662f\u6709\u7684\u3002<\/p>\n<p>\u90a3\u4e48&#xff0c;\u95ee\u9898\u5c31\u51fa\u5728\u4e86\u914d\u7f6e\u6587\u4ef6\u6ca1\u6709\u751f\u6548&#xff0c;\u4e8e\u662f&#xff0c;\u6211\u8fd0\u884c . ~\/.zshrc \u547d\u4ee4&#xff0c;\u4f7f\u914d\u7f6e\u6587\u4ef6\u751f\u6548&#xff0c;\u518d\u6b21\u8f93\u5165 nvm -v \u5c31\u53ef\u4ee5\u770b\u5230\u51fa\u73b0\u7248\u672c\u53f7&#xff0c;\u5c31\u8bf4\u660e&#xff0c;NVM \u5df2\u7ecf\u5b89\u88c5\u6210\u529f\u4e86\u3002<\/p>\n<p><img decoding=\"async\" src=\"https:\/\/www.wsisp.com\/helps\/wp-content\/uploads\/2025\/07\/20250729185147-68891843a049d.png\" alt=\"nvm \u5b89\u88c5\u5b8c\u6210\" \/><\/p>\n<p>source ~\/.zshrc \u547d\u4ee4\u7684\u4f5c\u7528\u662f\u8ba9 zsh \u7684\u914d\u7f6e\u6587\u4ef6\u7acb\u5373\u751f\u6548&#xff0c;\u5b83\u7684\u7b80\u5199\u5f62\u5f0f\u5c31\u662f\u6211\u4e0a\u9762\u7684 . ~\/.zshrc \u8fd9\u79cd\u7528\u6cd5\u3002\u5982\u679c\u4f60\u7528\u7684\u662f bash \u7ec8\u7aef\u89e3\u91ca\u5668&#xff0c;\u90a3\u4e48&#xff0c;\u5176\u547d\u4ee4\u5e94\u8be5\u662f . ~\/.bashrc<\/p>\n<h3>nvm \u5e38\u7528\u547d\u4ee4\u8bf4\u660e<\/h3>\n<table>\n<tr>\u547d\u4ee4\u8bf4\u660e<\/tr>\n<tbody>\n<tr>\n<td>nvm install <\/td>\n<td>\u5b89\u88c5\u6307\u5b9a Node.js \u7248\u672c&#xff08;\u5982 nvm install 18.17.1&#xff09;<\/td>\n<\/tr>\n<tr>\n<td>nvm use <\/td>\n<td>\u5207\u6362\u5230\u6307\u5b9a\u7248\u672c&#xff08;\u9700\u5df2\u5b89\u88c5&#xff09;<\/td>\n<\/tr>\n<tr>\n<td>nvm ls<\/td>\n<td>\u67e5\u770b\u5df2\u5b89\u88c5\u7684\u6240\u6709\u7248\u672c&#xff08;\u5f53\u524d\u4f7f\u7528\u7248\u672c\u9ad8\u4eae\u663e\u793a&#xff09;<\/td>\n<\/tr>\n<tr>\n<td>nvm ls-remote<\/td>\n<td>\u5217\u51fa\u6240\u6709\u53ef\u5b89\u88c5\u7684\u8fdc\u7a0b\u7248\u672c&#xff08;\u52a0 &#8211;lts \u4ec5\u663e\u793a\u957f\u671f\u652f\u6301\u7248&#xff09;<\/td>\n<\/tr>\n<tr>\n<td>nvm alias default <\/td>\n<td>\u8bbe\u7f6e\u9ed8\u8ba4\u7248\u672c&#xff08;\u65b0\u7ec8\u7aef\u81ea\u52a8\u751f\u6548&#xff09;<\/td>\n<\/tr>\n<tr>\n<td>nvm uninstall <\/td>\n<td>\u5378\u8f7d\u6307\u5b9a\u7248\u672c<\/td>\n<\/tr>\n<tr>\n<td>nvm current<\/td>\n<td>\u663e\u793a\u5f53\u524d\u4f7f\u7528\u7684 Node.js \u7248\u672c<\/td>\n<\/tr>\n<tr>\n<td>nvm which <\/td>\n<td>\u663e\u793a\u67d0\u7248\u672c\u7684 Node.js \u5b89\u88c5\u8def\u5f84<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<h3>\u5b89\u88c5 node V 22<\/h3>\n<p>OK&#xff0c;\u901a\u8fc7\u4e0a\u9762\u7684\u8868\u683c&#xff0c;\u6211\u4eec\u5927\u6982\u638c\u63e1\u4e86 nvm \u7684\u4f7f\u7528\u4e86&#xff0c;\u63a5\u4e0b\u6765&#xff0c;\u6211\u4eec\u5c31\u5f00\u59cb\u5b89\u88c5 Node<\/p>\n<p><span class=\"token comment\"># \u67e5\u770b\u53d7\u5230\u957f\u671f\u652f\u6301\u7684\u7248\u672c<\/span><br \/>\nnvm ls-remote <span class=\"token parameter variable\">&#8211;lts<\/span><\/p>\n<p><span class=\"token comment\"># \u5b89\u88c5 22.16.0 \u7248\u672c<\/span><br \/>\nnvm <span class=\"token function\">install<\/span> <span class=\"token number\">22.16<\/span>.0<\/p>\n<p><img decoding=\"async\" src=\"https:\/\/www.wsisp.com\/helps\/wp-content\/uploads\/2025\/07\/20250729185147-68891843d31f8.png\" alt=\"\u5b89\u88c5\u7ed3\u679c\" \/><\/p>\n<h4>\u8bbe\u7f6e npm \u6e90\u4e3a\u963f\u91cc\u6e90<\/h4>\n<p>\u9ed8\u8ba4\u60c5\u51b5\u4e0b&#xff0c;\u6211\u4eec\u5b89\u88c5\u4f9d\u8d56&#xff0c;\u662f\u8d70\u7684 npm \u7684\u5b98\u65b9\u6e90\u3002\u5b98\u65b9\u6e90\u5f88\u597d&#xff0c;\u53ea\u662f\u5728\u56fd\u5185\u7684\u901f\u5ea6\u6bd4\u8f83\u6162&#xff0c;\u56e0\u6b64&#xff0c;\u6211\u4eec\u4e00\u822c\u60c5\u51b5\u4e0b&#xff0c;\u5c06\u6e90\u8bbe\u7f6e\u4e3a\u963f\u91cc\u6e90\u3002\u5728\u67d0\u4e9b\u60c5\u51b5\u4e0b&#xff0c;\u9700\u8981\u4f7f\u7528\u5b98\u65b9\u6e90&#xff0c;\u5219\u518d\u8bbe\u7f6e\u56de\u53bb\u5373\u53ef\u3002<\/p>\n<p><span class=\"token comment\"># \u5c06 npm \u6e90\u8bbe\u7f6e\u4e3a\u963f\u91cc\u6e90<\/span><br \/>\n<span class=\"token function\">npm<\/span> config <span class=\"token builtin class-name\">set<\/span> registry https:\/\/registry.npmmirror.com<br \/>\n<span class=\"token comment\"># \u5c06 npm \u6e90\u8bbe\u7f6e\u4e3a\u5b98\u65b9\u6e90<\/span><br \/>\n<span class=\"token function\">npm<\/span> config <span class=\"token builtin class-name\">set<\/span> registry https:\/\/registry.npmjs.org<\/p>\n<p>\u914d\u7f6e\u597d\u6e90\u4ee5\u540e&#xff0c;\u6211\u4eec\u4ee5\u540e\u9879\u76ee\u7684\u5b89\u88c5\u901f\u5ea6\u4f1a\u6e9c\u6e9c\u7684\u5feb\u54e6&#xff01;<\/p>\n<h3>\u5b89\u88c5 pnpm \u7ba1\u7406\u5305<\/h3>\n<p>\u901a\u8fc7\u4e0a\u9762&#xff0c;\u6211\u4eec\u5df2\u7ecf\u5b89\u88c5\u597d\u4e86 NodeJS V22 \u7248\u672c\u4e86\u3002\u540c\u65f6&#xff0c;\u4e5f\u5df2\u7ecf\u5b89\u88c5\u4e86 node \u81ea\u5e26\u7684\u5305\u7ba1\u7406\u5668 npm \u5de5\u5177\u3002\u90a3\u4e48\u5f53\u524d&#xff0c; pnpm \u4f5c\u4e3a\u4e00\u4e2a\u66ff\u4ee3 npm \u7684\u5305\u7ba1\u7406\u5668&#xff0c;\u88ab\u5927\u5bb6\u5e7f\u53d7\u597d\u8bc4&#xff0c;\u56e0\u6b64&#xff0c;\u54b1\u4eec\u8fd9\u8fb9&#xff0c;\u4e5f\u5b89\u88c5\u4e0a pnpm \u7ba1\u7406\u5305\u5de5\u5177\u3002<\/p>\n<p>pnpm \u5b98\u65b9\u7f51\u7ad9&#xff1a;https:\/\/pnpm.io\/zh\/<\/p>\n<h4>&#x1f4e6; \u6838\u5fc3\u529f\u80fd\u5bf9\u6bd4<\/h4>\n<table>\n<tr>\u200c\u5bf9\u6bd4\u7ef4\u5ea6\u200c\u200cnpm\u200c\u200cpnpm\u200c<\/tr>\n<tbody>\n<tr>\n<td>\u200c\u5b58\u50a8\u673a\u5236\u200c<\/td>\n<td>\u6bcf\u4e2a\u9879\u76ee\u72ec\u7acb\u5b58\u50a8\u4f9d\u8d56&#xff0c;\u91cd\u590d\u5360\u7528\u7a7a\u95f4<\/td>\n<td>\u786c\u94fe\u63a5&#043;\u7b26\u53f7\u94fe\u63a5&#xff0c;\u5168\u5c40\u96c6\u4e2d\u5b58\u50a8\u4f9d\u8d56<\/td>\n<\/tr>\n<tr>\n<td>\u200c\u5b89\u88c5\u901f\u5ea6\u200c<\/td>\n<td>\u8f83\u6162&#xff08;\u9700\u5b8c\u6574\u4e0b\u8f7d\u89e3\u538b&#xff09;<\/td>\n<td>\u66f4\u5feb&#xff08;\u5229\u7528\u5168\u5c40\u7f13\u5b58\u94fe\u63a5&#xff09;<\/td>\n<\/tr>\n<tr>\n<td>\u200c\u78c1\u76d8\u5360\u7528\u200c<\/td>\n<td>\u9ad8&#xff08;\u76f8\u540c\u4f9d\u8d56\u91cd\u590d\u5b58\u50a8&#xff09;<\/td>\n<td>\u8282\u770150%&#043;\u7a7a\u95f4&#xff08;\u591a\u9879\u76ee\u5171\u4eab&#xff09;<\/td>\n<\/tr>\n<tr>\n<td>\u200c\u4f9d\u8d56\u7ed3\u6784\u200c<\/td>\n<td>\u5e73\u94fa\u5d4c\u5957&#xff0c;\u6613\u51b2\u7a81<\/td>\n<td>\u6241\u5e73\u5316&#043;\u7b26\u53f7\u94fe\u63a5&#xff0c;\u9694\u79bb\u6e05\u6670<\/td>\n<\/tr>\n<tr>\n<td>\u200c\u5b89\u5168\u6027\u200c<\/td>\n<td>\u53ef\u80fd\u5b58\u5728\u5e7d\u7075\u4f9d\u8d56<\/td>\n<td>\u6c99\u76d2\u9694\u79bb&#xff0c;\u5b89\u5168\u6027\u66f4\u9ad8<\/td>\n<\/tr>\n<tr>\n<td>\u200cMonorepo\u652f\u6301\u200c<\/td>\n<td>\u9700\u914d\u5408lerna\u7b49\u5de5\u5177<\/td>\n<td>\u539f\u751f\u9ad8\u6548\u652f\u6301<\/td>\n<\/tr>\n<tr>\n<td>\u200c\u517c\u5bb9\u6027\u200c<\/td>\n<td>\u751f\u6001\u6700\u5e7f\u6cdb<\/td>\n<td>\u517c\u5bb9npm\u4f46\u5c11\u6570\u63d2\u4ef6\u53ef\u80fd\u4e0d\u9002\u914d<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<h4>\u2696\ufe0f \u4f18\u7f3a\u70b9\u603b\u7ed3<\/h4>\n<h5>npm\u4f18\u52bf<\/h5>\n<li>\u200c\u751f\u6001\u6210\u719f\u200c&#xff1a;\u6700\u5927\u5305\u4ed3\u5e93\u652f\u6301<\/li>\n<li>\u200c\u96f6\u914d\u7f6e\u200c&#xff1a;Node.js\u5185\u7f6e\u5f00\u7bb1\u5373\u7528<\/li>\n<li>\u200c\u81ea\u52a8\u5316\u4f9d\u8d56\u5904\u7406\u200c&#xff1a;v3&#043;\u7248\u672c\u4f18\u5316\u4f9d\u8d56\u6811<\/li>\n<h5>npm\u52a3\u52bf<\/h5>\n<ul>\n<li>\u78c1\u76d8\u7a7a\u95f4\u6d6a\u8d39\u4e25\u91cd<\/li>\n<li>\u5927\u578b\u9879\u76ee\u5b89\u88c5\u6162<\/li>\n<li>\u5e73\u94fa\u7ed3\u6784\u6613\u5bfc\u81f4\u5e7d\u7075\u4f9d\u8d56<\/li>\n<\/ul>\n<h5>pnpm\u4f18\u52bf<\/h5>\n<li>\u200c\u6781\u81f4\u78c1\u76d8\u4f18\u5316\u200c&#xff1a;\u8282\u770150%-70%\u7a7a\u95f4<\/li>\n<li>\u200c\u5b89\u88c5\u901f\u5ea6\u9886\u5148\u200c&#xff1a;\u6bd4npm\u5feb2\u500d<\/li>\n<li>\u200c\u4f9d\u8d56\u9694\u79bb\u5b89\u5168\u200c&#xff1a;\u675c\u7edd\u975e\u6cd5\u5305\u8bbf\u95ee<\/li>\n<h5>pnpm\u52a3\u52bf<\/h5>\n<ul>\n<li>\u9700\u8981\u9002\u5e94\u94fe\u63a5\u673a\u5236<\/li>\n<li>\u6781\u5c11\u6570\u5386\u53f2\u63d2\u4ef6\u4e0d\u517c\u5bb9<\/li>\n<\/ul>\n<h4>&#x1f4a1; \u9009\u578b\u5efa\u8bae<\/h4>\n<ul>\n<li>\u200c\u9009\u62e9pnpm\u200c&#xff1a;\u9002\u5408\u4f9d\u8d56\u590d\u6742\u3001\u78c1\u76d8\u654f\u611f\u6216Monorepo\u9879\u76ee<\/li>\n<li>\u200c\u9009\u62e9npm\u200c&#xff1a;\u9002\u5408\u5c0f\u578b\u9879\u76ee\u6216\u9700\u8981\u6700\u5927\u517c\u5bb9\u6027\u65f6<\/li>\n<\/ul>\n<p>OK&#xff0c;\u4e0b\u9762\u6211\u4eec\u6765\u5b89\u88c5 pnpm&#xff0c;\u56e0\u4e3a\u6211\u4eec\u5df2\u7ecf\u5b89\u88c5\u4e86 Node&#xff0c;\u6240\u4ee5\u53ef\u4ee5\u7528 npm -g \u547d\u4ee4\u5b89\u88c5\u5230\u5168\u5c40\u3002<\/p>\n<p><span class=\"token function\">npm<\/span> <span class=\"token function\">install<\/span> <span class=\"token parameter variable\">-g<\/span> pnpm&#064;latest-10<\/p>\n<p><img decoding=\"async\" src=\"https:\/\/www.wsisp.com\/helps\/wp-content\/uploads\/2025\/07\/20250729185148-6889184424b93.png\" alt=\"\u5b89\u88c5 pnpm\" \/><\/p>\n<h3>\u5c0f\u7ed3<\/h3>\n<p>\u672c\u6765\u8ba1\u5212\u5728\u8fd9\u7bc7\u6587\u7ae0\u4e2d\u7ee7\u7eed\u8bb2\u89e3\u5b89\u88c5 Nginx \u7684&#xff0c;\u4f46\u662f\u770b\u770b\u6587\u7ae0\u5df2\u7ecf\u633a\u957f\u7684\u4e86&#xff0c;\u4e0b\u4e00\u7ae0\u518d\u8bb2\u5427\u3002<\/p>\n<p>\u6211\u8ba1\u5212\u5199\u4e00\u7cfb\u5217\u7684\u6587\u7ae0\u6765\u5b8c\u5584\u8fd9\u4e2a\u4e3b\u9898&#xff0c;\u914d\u7f6e Ubuntu Server \u7684 NodeJS \u670d\u52a1\u5668&#xff0c;\u76ee\u524d\u5df2\u7ecf\u5b8c\u6210\u4e94\u7bc7&#xff0c;\u5927\u5bb6\u559c\u6b22\u7684\u8bdd&#xff0c;\u4e00\u5b9a\u8981\u591a\u591a\u70b9\u8d5e\u6536\u85cf&#xff0c;\u8bc4\u8bba\u7559\u8a00&#xff0c;\u5173\u6ce8\u6211\u54e6&#xff01;\u8c22\u8c22\u5927\u5bb6&#xff01;<\/p>\n<p>\u5927\u6982\u76ee\u5f55\u5982\u4e0b&#xff1a;<\/p>\n<p>\u300aPVE\u865a\u62df\u673a \u5b89\u88c5 Ubuntu Server \u7cfb\u7edf\u300b \u300aSSH \u914d\u7f6e&#xff0c;\u8ba9\u6211\u4eec\u8fdc\u7a0b\u8fde\u4e0a\u865a\u62df\u673a\u300b \u300a\u670d\u52a1\u5668\u8f6f\u4ef6\u66f4\u65b0&#xff0c;\u4ee5\u53ca\u5e38\u7528\u8f6f\u4ef6\u5b89\u88c5\u300b \u300a\u914d\u7f6e\u670d\u52a1\u5668\u7ec8\u7aef\u73af\u5883 zsh , oh my zsh, vim\u300b \u300aNVM \u5b89\u88c5 NodeJS\u73af\u5883&#xff0c;\u4ee5\u53ca PNPM \u7684\u5b89\u88c5\u300b \u300aNginx \u548c Mysql \u7684\u5b89\u88c5\u548c\u914d\u7f6e\u300b \u300apm2 \u670d\u52a1\u7aef\u8fdb\u7a0b\u7ba1\u7406\u7684\u4f7f\u7528\u548c\u914d\u7f6e\u300b<\/p>\n","protected":false},"excerpt":{"rendered":"<p>\u6587\u7ae0\u6d4f\u89c8\u9605\u8bfb1.1k\u6b21\uff0c\u70b9\u8d5e19\u6b21\uff0c\u6536\u85cf27\u6b21\u3002\u672c\u6587\u4e3b\u8981\u4ecb\u7ecd\u4e86\u5728Ubuntu Server\u670d\u52a1\u5668\u4e0a\u5b89\u88c5\u548c\u914d\u7f6eNodeJS\u73af\u5883\u3002\u9996\u5148\u63a8\u8350\u4f7f\u7528nvm\u4f5c\u4e3aNode\u7248\u672c\u7ba1\u7406\u5668\uff0c\u8be6\u7ec6\u8bf4\u660e\u4e86nvm\u7684\u5b89\u88c5\u6b65\u9aa4\u548c\u5e38\u89c1\u547d\u4ee4\u3002\u63a5\u7740\u6f14\u793a\u4e86\u5b89\u88c5NodeJS 22\u7248\u672c\u7684\u8fc7\u7a0b\uff0c\u5e76\u5efa\u8bae\u5c06npm\u6e90\u8bbe\u7f6e\u4e3a\u963f\u91cc\u6e90\u4ee5\u63d0\u9ad8\u4e0b\u8f7d\u901f\u5ea6\u3002\u6587\u7ae0\u8fd8\u5bf9\u6bd4\u4e86npm\u548cpnpm\u7684\u6838\u5fc3\u529f\u80fd\u5dee\u5f02\uff0c\u63a8\u8350\u5b89\u88c5pnpm\u4f5c\u4e3a\u5305\u7ba1\u7406\u5de5\u5177\uff0c\u5e76\u7ed9\u51fa\u5177\u4f53\u5b89\u88c5\u547d\u4ee4\u3002\u6700\u540e\u4f5c\u8005\u8868\u793a\u5c06\u5728\u540e\u7eed\u6587\u7ae0\u4e2d\u7ee7\u7eed\u8bb2\u89e3Nginx\u7b49\u5de5\u5177\u7684\u5b89\u88c5\u914d\u7f6e\u3002\u672c\u6587\u662fUbuntu Server\u670d\u52a1\u5668\u914d\u7f6e\u7cfb\u5217\u6559\u7a0b\u7684\u7b2c\u4e94\u7bc7\uff0c\u4e3a\u524d\u7aef\u5f00\u53d1\u8005\u63d0\u4f9b\u4e86\u670d\u52a1\u5668\u73af\u5883\u642d\u5efa\u7684\u5b9e\u7528\u6307\u5357\u3002_\u670d\u52a1\u5668\u5b89\u88c5pnpm<\/p>\n","protected":false},"author":2,"featured_media":46313,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[1],"tags":[3848,58,1282,4413,4414,103,3849],"topic":[],"class_list":["post-46318","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-server","tag-fungleo","tag-linux","tag-nodejs","tag-nvm","tag-pnpm","tag-ubuntu","tag-ubuntu-server"],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v20.3 - https:\/\/yoast.com\/wordpress\/plugins\/seo\/ -->\n<title>NVM \u5b89\u88c5 NodeJS\u73af\u5883\uff0c\u4ee5\u53ca PNPM \u7684\u5b89\u88c5 \u2014\u2014 \u4e00\u6b65\u4e00\u6b65\u914d\u7f6e Ubuntu Server \u7684 NodeJS \u670d\u52a1\u5668\u8be6\u7ec6\u5b9e\u5f55 5 - \u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3<\/title>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/www.wsisp.com\/helps\/46318.html\" \/>\n<meta property=\"og:locale\" content=\"zh_CN\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"NVM \u5b89\u88c5 NodeJS\u73af\u5883\uff0c\u4ee5\u53ca PNPM \u7684\u5b89\u88c5 \u2014\u2014 \u4e00\u6b65\u4e00\u6b65\u914d\u7f6e Ubuntu Server \u7684 NodeJS \u670d\u52a1\u5668\u8be6\u7ec6\u5b9e\u5f55 5 - \u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3\" \/>\n<meta property=\"og:description\" content=\"\u6587\u7ae0\u6d4f\u89c8\u9605\u8bfb1.1k\u6b21\uff0c\u70b9\u8d5e19\u6b21\uff0c\u6536\u85cf27\u6b21\u3002\u672c\u6587\u4e3b\u8981\u4ecb\u7ecd\u4e86\u5728Ubuntu Server\u670d\u52a1\u5668\u4e0a\u5b89\u88c5\u548c\u914d\u7f6eNodeJS\u73af\u5883\u3002\u9996\u5148\u63a8\u8350\u4f7f\u7528nvm\u4f5c\u4e3aNode\u7248\u672c\u7ba1\u7406\u5668\uff0c\u8be6\u7ec6\u8bf4\u660e\u4e86nvm\u7684\u5b89\u88c5\u6b65\u9aa4\u548c\u5e38\u89c1\u547d\u4ee4\u3002\u63a5\u7740\u6f14\u793a\u4e86\u5b89\u88c5NodeJS 22\u7248\u672c\u7684\u8fc7\u7a0b\uff0c\u5e76\u5efa\u8bae\u5c06npm\u6e90\u8bbe\u7f6e\u4e3a\u963f\u91cc\u6e90\u4ee5\u63d0\u9ad8\u4e0b\u8f7d\u901f\u5ea6\u3002\u6587\u7ae0\u8fd8\u5bf9\u6bd4\u4e86npm\u548cpnpm\u7684\u6838\u5fc3\u529f\u80fd\u5dee\u5f02\uff0c\u63a8\u8350\u5b89\u88c5pnpm\u4f5c\u4e3a\u5305\u7ba1\u7406\u5de5\u5177\uff0c\u5e76\u7ed9\u51fa\u5177\u4f53\u5b89\u88c5\u547d\u4ee4\u3002\u6700\u540e\u4f5c\u8005\u8868\u793a\u5c06\u5728\u540e\u7eed\u6587\u7ae0\u4e2d\u7ee7\u7eed\u8bb2\u89e3Nginx\u7b49\u5de5\u5177\u7684\u5b89\u88c5\u914d\u7f6e\u3002\u672c\u6587\u662fUbuntu Server\u670d\u52a1\u5668\u914d\u7f6e\u7cfb\u5217\u6559\u7a0b\u7684\u7b2c\u4e94\u7bc7\uff0c\u4e3a\u524d\u7aef\u5f00\u53d1\u8005\u63d0\u4f9b\u4e86\u670d\u52a1\u5668\u73af\u5883\u642d\u5efa\u7684\u5b9e\u7528\u6307\u5357\u3002_\u670d\u52a1\u5668\u5b89\u88c5pnpm\" \/>\n<meta property=\"og:url\" content=\"https:\/\/www.wsisp.com\/helps\/46318.html\" \/>\n<meta property=\"og:site_name\" content=\"\u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3\" \/>\n<meta property=\"article:published_time\" content=\"2025-07-29T18:51:49+00:00\" \/>\n<meta property=\"og:image\" content=\"https:\/\/www.wsisp.com\/helps\/wp-content\/uploads\/2025\/07\/20250729185146-6889184241274.png\" \/>\n<meta name=\"author\" content=\"admin\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:label1\" content=\"\u4f5c\u8005\" \/>\n\t<meta name=\"twitter:data1\" content=\"admin\" \/>\n\t<meta name=\"twitter:label2\" content=\"\u9884\u8ba1\u9605\u8bfb\u65f6\u95f4\" \/>\n\t<meta name=\"twitter:data2\" content=\"2 \u5206\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\/\/schema.org\",\"@graph\":[{\"@type\":\"WebPage\",\"@id\":\"https:\/\/www.wsisp.com\/helps\/46318.html\",\"url\":\"https:\/\/www.wsisp.com\/helps\/46318.html\",\"name\":\"NVM \u5b89\u88c5 NodeJS\u73af\u5883\uff0c\u4ee5\u53ca PNPM \u7684\u5b89\u88c5 \u2014\u2014 \u4e00\u6b65\u4e00\u6b65\u914d\u7f6e Ubuntu Server \u7684 NodeJS \u670d\u52a1\u5668\u8be6\u7ec6\u5b9e\u5f55 5 - \u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3\",\"isPartOf\":{\"@id\":\"https:\/\/www.wsisp.com\/helps\/#website\"},\"datePublished\":\"2025-07-29T18:51:49+00:00\",\"dateModified\":\"2025-07-29T18:51:49+00:00\",\"author\":{\"@id\":\"https:\/\/www.wsisp.com\/helps\/#\/schema\/person\/358e386c577a3ab51c4493330a20ad41\"},\"breadcrumb\":{\"@id\":\"https:\/\/www.wsisp.com\/helps\/46318.html#breadcrumb\"},\"inLanguage\":\"zh-Hans\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\/\/www.wsisp.com\/helps\/46318.html\"]}]},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\/\/www.wsisp.com\/helps\/46318.html#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"\u9996\u9875\",\"item\":\"https:\/\/www.wsisp.com\/helps\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"NVM \u5b89\u88c5 NodeJS\u73af\u5883\uff0c\u4ee5\u53ca PNPM \u7684\u5b89\u88c5 \u2014\u2014 \u4e00\u6b65\u4e00\u6b65\u914d\u7f6e Ubuntu Server \u7684 NodeJS \u670d\u52a1\u5668\u8be6\u7ec6\u5b9e\u5f55 5\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\/\/www.wsisp.com\/helps\/#website\",\"url\":\"https:\/\/www.wsisp.com\/helps\/\",\"name\":\"\u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3\",\"description\":\"\u9999\u6e2f\u670d\u52a1\u5668_\u9999\u6e2f\u4e91\u670d\u52a1\u5668\u8d44\u8baf_\u670d\u52a1\u5668\u5e2e\u52a9\u6587\u6863_\u670d\u52a1\u5668\u6559\u7a0b\",\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\/\/www.wsisp.com\/helps\/?s={search_term_string}\"},\"query-input\":\"required name=search_term_string\"}],\"inLanguage\":\"zh-Hans\"},{\"@type\":\"Person\",\"@id\":\"https:\/\/www.wsisp.com\/helps\/#\/schema\/person\/358e386c577a3ab51c4493330a20ad41\",\"name\":\"admin\",\"image\":{\"@type\":\"ImageObject\",\"inLanguage\":\"zh-Hans\",\"@id\":\"https:\/\/www.wsisp.com\/helps\/#\/schema\/person\/image\/\",\"url\":\"https:\/\/gravatar.wp-china-yes.net\/avatar\/?s=96&d=mystery\",\"contentUrl\":\"https:\/\/gravatar.wp-china-yes.net\/avatar\/?s=96&d=mystery\",\"caption\":\"admin\"},\"sameAs\":[\"http:\/\/wp.wsisp.com\"],\"url\":\"https:\/\/www.wsisp.com\/helps\/author\/admin\"}]}<\/script>\n<!-- \/ Yoast SEO plugin. -->","yoast_head_json":{"title":"NVM \u5b89\u88c5 NodeJS\u73af\u5883\uff0c\u4ee5\u53ca PNPM \u7684\u5b89\u88c5 \u2014\u2014 \u4e00\u6b65\u4e00\u6b65\u914d\u7f6e Ubuntu Server \u7684 NodeJS \u670d\u52a1\u5668\u8be6\u7ec6\u5b9e\u5f55 5 - \u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3","robots":{"index":"index","follow":"follow","max-snippet":"max-snippet:-1","max-image-preview":"max-image-preview:large","max-video-preview":"max-video-preview:-1"},"canonical":"https:\/\/www.wsisp.com\/helps\/46318.html","og_locale":"zh_CN","og_type":"article","og_title":"NVM \u5b89\u88c5 NodeJS\u73af\u5883\uff0c\u4ee5\u53ca PNPM \u7684\u5b89\u88c5 \u2014\u2014 \u4e00\u6b65\u4e00\u6b65\u914d\u7f6e Ubuntu Server \u7684 NodeJS \u670d\u52a1\u5668\u8be6\u7ec6\u5b9e\u5f55 5 - \u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3","og_description":"\u6587\u7ae0\u6d4f\u89c8\u9605\u8bfb1.1k\u6b21\uff0c\u70b9\u8d5e19\u6b21\uff0c\u6536\u85cf27\u6b21\u3002\u672c\u6587\u4e3b\u8981\u4ecb\u7ecd\u4e86\u5728Ubuntu Server\u670d\u52a1\u5668\u4e0a\u5b89\u88c5\u548c\u914d\u7f6eNodeJS\u73af\u5883\u3002\u9996\u5148\u63a8\u8350\u4f7f\u7528nvm\u4f5c\u4e3aNode\u7248\u672c\u7ba1\u7406\u5668\uff0c\u8be6\u7ec6\u8bf4\u660e\u4e86nvm\u7684\u5b89\u88c5\u6b65\u9aa4\u548c\u5e38\u89c1\u547d\u4ee4\u3002\u63a5\u7740\u6f14\u793a\u4e86\u5b89\u88c5NodeJS 22\u7248\u672c\u7684\u8fc7\u7a0b\uff0c\u5e76\u5efa\u8bae\u5c06npm\u6e90\u8bbe\u7f6e\u4e3a\u963f\u91cc\u6e90\u4ee5\u63d0\u9ad8\u4e0b\u8f7d\u901f\u5ea6\u3002\u6587\u7ae0\u8fd8\u5bf9\u6bd4\u4e86npm\u548cpnpm\u7684\u6838\u5fc3\u529f\u80fd\u5dee\u5f02\uff0c\u63a8\u8350\u5b89\u88c5pnpm\u4f5c\u4e3a\u5305\u7ba1\u7406\u5de5\u5177\uff0c\u5e76\u7ed9\u51fa\u5177\u4f53\u5b89\u88c5\u547d\u4ee4\u3002\u6700\u540e\u4f5c\u8005\u8868\u793a\u5c06\u5728\u540e\u7eed\u6587\u7ae0\u4e2d\u7ee7\u7eed\u8bb2\u89e3Nginx\u7b49\u5de5\u5177\u7684\u5b89\u88c5\u914d\u7f6e\u3002\u672c\u6587\u662fUbuntu Server\u670d\u52a1\u5668\u914d\u7f6e\u7cfb\u5217\u6559\u7a0b\u7684\u7b2c\u4e94\u7bc7\uff0c\u4e3a\u524d\u7aef\u5f00\u53d1\u8005\u63d0\u4f9b\u4e86\u670d\u52a1\u5668\u73af\u5883\u642d\u5efa\u7684\u5b9e\u7528\u6307\u5357\u3002_\u670d\u52a1\u5668\u5b89\u88c5pnpm","og_url":"https:\/\/www.wsisp.com\/helps\/46318.html","og_site_name":"\u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3","article_published_time":"2025-07-29T18:51:49+00:00","og_image":[{"url":"https:\/\/www.wsisp.com\/helps\/wp-content\/uploads\/2025\/07\/20250729185146-6889184241274.png"}],"author":"admin","twitter_card":"summary_large_image","twitter_misc":{"\u4f5c\u8005":"admin","\u9884\u8ba1\u9605\u8bfb\u65f6\u95f4":"2 \u5206"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"WebPage","@id":"https:\/\/www.wsisp.com\/helps\/46318.html","url":"https:\/\/www.wsisp.com\/helps\/46318.html","name":"NVM \u5b89\u88c5 NodeJS\u73af\u5883\uff0c\u4ee5\u53ca PNPM \u7684\u5b89\u88c5 \u2014\u2014 \u4e00\u6b65\u4e00\u6b65\u914d\u7f6e Ubuntu Server \u7684 NodeJS \u670d\u52a1\u5668\u8be6\u7ec6\u5b9e\u5f55 5 - \u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3","isPartOf":{"@id":"https:\/\/www.wsisp.com\/helps\/#website"},"datePublished":"2025-07-29T18:51:49+00:00","dateModified":"2025-07-29T18:51:49+00:00","author":{"@id":"https:\/\/www.wsisp.com\/helps\/#\/schema\/person\/358e386c577a3ab51c4493330a20ad41"},"breadcrumb":{"@id":"https:\/\/www.wsisp.com\/helps\/46318.html#breadcrumb"},"inLanguage":"zh-Hans","potentialAction":[{"@type":"ReadAction","target":["https:\/\/www.wsisp.com\/helps\/46318.html"]}]},{"@type":"BreadcrumbList","@id":"https:\/\/www.wsisp.com\/helps\/46318.html#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"\u9996\u9875","item":"https:\/\/www.wsisp.com\/helps"},{"@type":"ListItem","position":2,"name":"NVM \u5b89\u88c5 NodeJS\u73af\u5883\uff0c\u4ee5\u53ca PNPM \u7684\u5b89\u88c5 \u2014\u2014 \u4e00\u6b65\u4e00\u6b65\u914d\u7f6e Ubuntu Server \u7684 NodeJS \u670d\u52a1\u5668\u8be6\u7ec6\u5b9e\u5f55 5"}]},{"@type":"WebSite","@id":"https:\/\/www.wsisp.com\/helps\/#website","url":"https:\/\/www.wsisp.com\/helps\/","name":"\u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3","description":"\u9999\u6e2f\u670d\u52a1\u5668_\u9999\u6e2f\u4e91\u670d\u52a1\u5668\u8d44\u8baf_\u670d\u52a1\u5668\u5e2e\u52a9\u6587\u6863_\u670d\u52a1\u5668\u6559\u7a0b","potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/www.wsisp.com\/helps\/?s={search_term_string}"},"query-input":"required name=search_term_string"}],"inLanguage":"zh-Hans"},{"@type":"Person","@id":"https:\/\/www.wsisp.com\/helps\/#\/schema\/person\/358e386c577a3ab51c4493330a20ad41","name":"admin","image":{"@type":"ImageObject","inLanguage":"zh-Hans","@id":"https:\/\/www.wsisp.com\/helps\/#\/schema\/person\/image\/","url":"https:\/\/gravatar.wp-china-yes.net\/avatar\/?s=96&d=mystery","contentUrl":"https:\/\/gravatar.wp-china-yes.net\/avatar\/?s=96&d=mystery","caption":"admin"},"sameAs":["http:\/\/wp.wsisp.com"],"url":"https:\/\/www.wsisp.com\/helps\/author\/admin"}]}},"_links":{"self":[{"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/posts\/46318","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/users\/2"}],"replies":[{"embeddable":true,"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/comments?post=46318"}],"version-history":[{"count":0,"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/posts\/46318\/revisions"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/media\/46313"}],"wp:attachment":[{"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/media?parent=46318"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/categories?post=46318"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/tags?post=46318"},{"taxonomy":"topic","embeddable":true,"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/topic?post=46318"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}