{"id":1546,"date":"2024-10-15T11:42:01","date_gmt":"2024-10-15T03:42:01","guid":{"rendered":"https:\/\/www.madbull.site\/?p=1546"},"modified":"2025-10-16T16:53:43","modified_gmt":"2025-10-16T08:53:43","slug":"pnpm%e5%bc%80%e5%8f%91%e7%8e%af%e5%a2%83","status":"publish","type":"post","link":"https:\/\/www.madbull.site\/?p=1546","title":{"rendered":"pnpm\u5f00\u53d1\u73af\u5883\u642d\u5efa"},"content":{"rendered":"\n<p>\u672c\u6b21\u4ee5 debian \u7cfb\u5217\u4e3a\u4f8b<\/p>\n\n\n\n<div style=\"margin-top:var(--wp--preset--spacing--10);margin-bottom:var(--wp--preset--spacing--10);height:0px\" aria-hidden=\"true\" class=\"wp-block-spacer\"><\/div>\n\n\n\n<div class=\"wp-block-group has-global-padding is-layout-constrained wp-block-group-is-layout-constrained\">\n<p class=\"has-large-font-size\"><strong>1\u3001\u5b89\u88c5 nodejs \u548c npm<\/strong><\/p>\n\n\n\n<p>\u8fd9\u4e24\u4e2a\u5de5\u5177\u662f\u57fa\u7840\uff0c\u6307\u4ee4\uff1a<code>apt install nodejs npm<\/code><\/p>\n<\/div>\n\n\n\n<div style=\"margin-top:var(--wp--preset--spacing--10);margin-bottom:var(--wp--preset--spacing--10);height:0px\" aria-hidden=\"true\" class=\"wp-block-spacer\"><\/div>\n\n\n\n<div class=\"wp-block-group has-global-padding is-layout-constrained wp-block-group-is-layout-constrained\">\n<p class=\"has-large-font-size\"><strong>2\u3001\u4fee\u6539\u6e90<\/strong><\/p>\n\n\n\n<p>\u8bbe\u7f6e\u56fd\u5185\u6dd8\u5b9d\u6e90\uff1a<code>npm config set registry https:\/\/registry.npm.taobao.org\/<\/code><\/p>\n\n\n\n<p>\u7531\u4e8e\u6dd8\u5b9d\u6e90\u7684\u8bc1\u4e66\u8fc7\u671f\u4e86\uff0c\u8fd8\u9700\u8981\u5ffd\u7565\u8bc1\u4e66\u9a8c\u8bc1\uff0c\u8bbe\u7f6e\uff1a<code>npm config set strict-ssl=false<\/code><\/p>\n\n\n\n<p>\u67e5\u770b\u5f53\u524d\u8bbe\u7f6e\uff1a<code>npm config ls -l<\/code><\/p>\n<\/div>\n\n\n\n<div style=\"margin-top:var(--wp--preset--spacing--10);margin-bottom:var(--wp--preset--spacing--10);height:0px\" aria-hidden=\"true\" class=\"wp-block-spacer\"><\/div>\n\n\n\n<div class=\"wp-block-group has-global-padding is-layout-constrained wp-block-group-is-layout-constrained\">\n<p class=\"has-large-font-size\"><strong>3\u3001\u5b89\u88c5 pnpm<\/strong><\/p>\n\n\n\n<p>\u5982\u679c\u6ca1\u6709pnpm\u547d\u4ee4\uff0c\u9700\u8981\u5b89\u88c5\u3002\u5982\u679c\u5df2\u7ecf\u6709\u6b64\u547d\u4ee4\uff0c\u5219\u4e0d\u9700\u8981\u91cd\u590d\u5b89\u88c5\u3002\u6307\u4ee4\uff1a<code>npm install -g pnpm<\/code><\/p>\n\n\n\n<p>\u589e\u52a0 -g \u9ed8\u8ba4\u5b89\u88c5\u5728 \/usr\/local\/lib\/node_modules\/pnpm \u76ee\u5f55\uff0c<\/p>\n\n\n\n<p>\u5e76\u521b\u5efa\u8fde\u63a5\uff1a\/usr\/local\/bin\/pnpm -> ..\/lib\/node_modules\/pnpm\/bin\/pnpm.cjs<\/p>\n\n\n\n<p>\u8fd9\u6837 pnpm \u5c31\u53ef\u4ee5\u50cf\u547d\u4ee4\u4e00\u6837\u4f7f\u7528\u4e86\u3002<\/p>\n<\/div>\n\n\n\n<div style=\"margin-top:var(--wp--preset--spacing--10);margin-bottom:var(--wp--preset--spacing--10);height:0px\" aria-hidden=\"true\" class=\"wp-block-spacer\"><\/div>\n\n\n\n<div class=\"wp-block-group has-global-padding is-layout-constrained wp-block-group-is-layout-constrained\">\n<p class=\"has-large-font-size\"><strong>4\u3001\u81ea\u52a8\u5b89\u88c5\u53ca\u7f16\u8bd1<\/strong><\/p>\n\n\n\n<p>\u5728\u9700\u8981\u7f16\u8bd1\u7684\u9879\u76ee\u4e0b\uff0c\u6267\u884c\uff1a<code><strong>pnpm i<\/strong><\/code> \u81ea\u52a8\u4e0b\u8f7d\u9879\u76ee\u4f9d\u8d56\u7684\u5e93<\/p>\n\n\n\n<p>\u7f16\u8bd1\uff1a<code>VITE_APP_URL=\/api\/ pnpm build<\/code><\/p>\n\n\n\n<p><code>VITE_APP_URL<\/code>\u7528\u6765\u8bbe\u7f6eAPI\u65ad\u70b9\u3002\u5982\u679c\u662f\u56fa\u5b9a\u5730\u5740\uff0c\u53ef\u4ee5\u5199\u5b8c\u6574\u7684\u57df\u540d\u6216\u8005IP\uff0c\u5982\uff1a<code>VITE_APP_URL=https:\/\/xxxx.yyy.com:9933\/api<\/code><\/p>\n<\/div>\n\n\n\n<div style=\"margin-top:var(--wp--preset--spacing--10);margin-bottom:var(--wp--preset--spacing--10);height:0px\" aria-hidden=\"true\" class=\"wp-block-spacer\"><\/div>\n\n\n\n<div class=\"wp-block-group has-global-padding is-layout-constrained wp-block-group-is-layout-constrained\">\n<p class=\"has-large-font-size\"><strong>\u793a\u4f8b\uff1a<\/strong><\/p>\n\n\n\n<figure class=\"wp-block-image size-full\"><img loading=\"lazy\" decoding=\"async\" width=\"683\" height=\"460\" src=\"https:\/\/www.madbull.site\/wp-content\/uploads\/2024\/10\/\u56fe\u7247-10.png\" alt=\"\" class=\"wp-image-1547\" srcset=\"https:\/\/www.madbull.site\/wp-content\/uploads\/2024\/10\/\u56fe\u7247-10.png 683w, https:\/\/www.madbull.site\/wp-content\/uploads\/2024\/10\/\u56fe\u7247-10-300x202.png 300w\" sizes=\"auto, (max-width: 683px) 100vw, 683px\" \/><\/figure>\n<\/div>\n\n\n\n<div style=\"margin-top:var(--wp--preset--spacing--40);margin-bottom:var(--wp--preset--spacing--40);height:0px\" aria-hidden=\"true\" class=\"wp-block-spacer\"><\/div>\n\n\n\n<hr class=\"wp-block-separator has-alpha-channel-opacity is-style-wide\"\/>\n\n\n\n<div style=\"margin-top:var(--wp--preset--spacing--10);margin-bottom:var(--wp--preset--spacing--10);height:0px\" aria-hidden=\"true\" class=\"wp-block-spacer\"><\/div>\n\n\n\n<p>\u6ce8\u610f\uff1a<code>pnpm i<\/code> \u4e0b\u8f7d\u4f9d\u8d56\u7684\u65f6\u5019\uff0c\u6709\u53ef\u80fd\u4f1a\u8986\u76d6\u914d\u7f6e\u9879\uff0c\u53ef\u7528 <code>npm config get registry<\/code> \u548c <code>npm config get strict-ssl<\/code> \u67e5\u770b\u914d\u7f6e\u662f\u5426\u88ab\u4fee\u6539\u3002<\/p>\n","protected":false},"excerpt":{"rendered":"<p>\u672c\u6b21\u4ee5 debian \u7cfb\u5217\u4e3a\u4f8b 1\u3001\u5b89\u88c5 nodejs \u548c npm \u8fd9\u4e24\u4e2a\u5de5\u5177\u662f\u57fa\u7840\uff0c\u6307\u4ee4\uff1aapt insta [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":1548,"comment_status":"open","ping_status":"open","sticky":false,"template":"single-with-sidebar","format":"standard","meta":{"footnotes":""},"categories":[166,154],"tags":[509,510,506,507,367,508],"class_list":["post-1546","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-tools","category-154","tag-apt","tag-build","tag-npm","tag-pnpm","tag-367","tag-508"],"_links":{"self":[{"href":"https:\/\/www.madbull.site\/index.php?rest_route=\/wp\/v2\/posts\/1546","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.madbull.site\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.madbull.site\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.madbull.site\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.madbull.site\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=1546"}],"version-history":[{"count":7,"href":"https:\/\/www.madbull.site\/index.php?rest_route=\/wp\/v2\/posts\/1546\/revisions"}],"predecessor-version":[{"id":2393,"href":"https:\/\/www.madbull.site\/index.php?rest_route=\/wp\/v2\/posts\/1546\/revisions\/2393"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/www.madbull.site\/index.php?rest_route=\/wp\/v2\/media\/1548"}],"wp:attachment":[{"href":"https:\/\/www.madbull.site\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=1546"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.madbull.site\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=1546"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.madbull.site\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=1546"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}