{"id":69427,"date":"2026-01-31T17:17:08","date_gmt":"2026-01-31T09:17:08","guid":{"rendered":"https:\/\/www.wsisp.com\/helps\/69427.html"},"modified":"2026-01-31T17:17:08","modified_gmt":"2026-01-31T09:17:08","slug":"%e5%be%ae%e4%bf%a1%e5%b0%8f%e7%a8%8b%e5%ba%8f%e4%bd%bf%e7%94%a8-npm-%e5%8c%85","status":"publish","type":"post","link":"https:\/\/www.wsisp.com\/helps\/69427.html","title":{"rendered":"\u5fae\u4fe1\u5c0f\u7a0b\u5e8f\u4f7f\u7528 npm \u5305"},"content":{"rendered":"<h3>\u4e00\u3001\u524d\u8a00&#xff1a;\u4e3a\u4ec0\u4e48\u5c0f\u7a0b\u5e8f\u4e5f\u80fd\u7528 npm&#xff1f;<\/h3>\n<p>\u4f60\u662f\u5426\u8fd8\u5728&#xff1a;<\/p>\n<ul>\n<li>\u624b\u52a8\u590d\u5236\u00a0lodash\u00a0\u6e90\u7801\u5230\u9879\u76ee\u4e2d&#xff1f;<\/li>\n<li>\u81ea\u5df1\u5c01\u88c5\u65e5\u671f\u683c\u5f0f\u5316\u51fd\u6570&#xff1f;<\/li>\n<li>\u91cd\u590d\u9020\u8f6e\u5b50\u5904\u7406\u9632\u6296\u3001\u6df1\u62f7\u8d1d\u7b49\u901a\u7528\u903b\u8f91&#xff1f;<\/li>\n<\/ul>\n<p>\u597d\u6d88\u606f&#xff1a;\u5fae\u4fe1\u5c0f\u7a0b\u5e8f\u81ea\u57fa\u7840\u5e93 2.2.1 \u8d77&#xff0c;\u6b63\u5f0f\u652f\u6301\u4f7f\u7528 npm \u5305&#xff01;<\/p>\n<p>\u901a\u8fc7\u5b98\u65b9\u63d0\u4f9b\u7684\u00a0\u201c\u6784\u5efa npm\u201d\u00a0\u529f\u80fd&#xff0c;\u4f60\u53ef\u4ee5\u50cf\u5728 Vue\/React \u4e2d\u4e00\u6837&#xff0c;\u76f4\u63a5\u00a0npm install\u00a0\u5b89\u88c5\u7b2c\u4e09\u65b9\u5e93&#xff0c;\u5927\u5e45\u63d0\u5347\u5f00\u53d1\u6548\u7387\u548c\u4ee3\u7801\u8d28\u91cf\u3002<\/p>\n<p>\u672c\u6587\u5c06\u624b\u628a\u624b\u6559\u4f60\u5728\u5c0f\u7a0b\u5e8f\u4e2d\u6b63\u786e\u4f7f\u7528 npm \u5305&#xff0c;\u5e76\u907f\u5f00\u901a\u5f80\u201c\u6784\u5efa\u5931\u8d25\u201d\u7684\u5751\u3002<\/p>\n<hr \/>\n<h3>\u4e8c\u3001\u524d\u63d0\u6761\u4ef6<\/h3>\n<p>\u2705 \u5c0f\u7a0b\u5e8f\u57fa\u7840\u5e93 \u2265 2.2.1&#xff08;\u5f53\u524d\u6700\u65b0\u7248\u5df2\u9ed8\u8ba4\u6ee1\u8db3&#xff09; \u2705 \u5f00\u53d1\u8005\u5de5\u5177 \u2265 1.02.1810290&#xff08;\u5efa\u8bae\u4f7f\u7528\u6700\u65b0\u7a33\u5b9a\u7248&#xff09; \u2705 \u9879\u76ee\u5df2\u542f\u7528\u00a0\u201c\u4f7f\u7528 npm \u6a21\u5757\u201d&#xff08;\u65b0\u7248\u5de5\u5177\u9ed8\u8ba4\u5f00\u542f&#xff09;<\/p>\n<p>&#x1f4a1; \u6253\u5f00\u5f00\u53d1\u8005\u5de5\u5177 \u2192 \u8be6\u60c5 \u2192 \u9879\u76ee\u8bbe\u7f6e \u2192 \u52fe\u9009\u00a0\u201c\u4f7f\u7528 npm \u6a21\u5757\u201d<\/p>\n<hr \/>\n<h3>\u4e09\u3001\u5b8c\u6574\u64cd\u4f5c\u6d41\u7a0b&#xff08;\u4ee5\u00a0dayjs\u00a0\u4e3a\u4f8b&#xff09;<\/h3>\n<h4>\u7b2c\u4e00\u6b65&#xff1a;\u521d\u59cb\u5316 package.json&#xff08;\u5982\u679c\u8fd8\u6ca1\u6709&#xff09;<\/h4>\n<p>\u5728\u5c0f\u7a0b\u5e8f\u9879\u76ee\u6839\u76ee\u5f55\u4e0b\u6267\u884c&#xff1a;<\/p>\n<p>npm init -y <\/p>\n<p>\u4f1a\u751f\u6210\u00a0package.json\u00a0\u6587\u4ef6\u3002<\/p>\n<hr \/>\n<h4>\u7b2c\u4e8c\u6b65&#xff1a;\u5b89\u88c5 npm \u5305<\/h4>\n<p>npm install dayjs &#8211;save <\/p>\n<p>\u26a0\ufe0f \u6ce8\u610f&#xff1a;<\/p>\n<ul>\n<li>\u4e0d\u8981\u5b89\u88c5\u6d4f\u89c8\u5668\u6216 Node.js \u4e13\u7528\u5305&#xff08;\u5982\u00a0fs,\u00a0path&#xff09;<\/li>\n<li>\u4f18\u5148\u9009\u62e9\u00a0\u8f7b\u91cf\u3001\u65e0 DOM \u4f9d\u8d56\u00a0\u7684\u5e93&#xff08;\u5982\u00a0dayjs\u00a0\u4f18\u4e8e\u00a0moment&#xff09;<\/li>\n<\/ul>\n<hr \/>\n<h4>\u7b2c\u4e09\u6b65&#xff1a;\u5728\u4ee3\u7801\u4e2d\u5f15\u5165<\/h4>\n<p>\/\/ pages\/index\/index.js<br \/>\nimport dayjs from &#039;dayjs&#039;;<\/p>\n<p>Page({<br \/>\n  onLoad() {<br \/>\n    const now &#061; dayjs().format(&#039;YYYY-MM-DD HH:mm:ss&#039;);<br \/>\n    console.log(&#039;\u5f53\u524d\u65f6\u95f4:&#039;, now);<br \/>\n    this.setData({ currentTime: now });<br \/>\n  }<br \/>\n}); <\/p>\n<hr \/>\n<h4>\u7b2c\u56db\u6b65&#xff1a;\u3010\u5173\u952e\u3011\u70b9\u51fb\u5f00\u53d1\u8005\u5de5\u5177 \u2192 \u5de5\u5177 \u2192 \u6784\u5efa npm<\/h4>\n<p>&#x1f511;\u00a0\u5fc5\u987b\u6267\u884c\u6b64\u6b65\u9aa4&#xff01;\u5426\u5219\u4f1a\u62a5\u9519&#xff1a;<\/p>\n<p> Module not found: Can&#039;t resolve &#039;dayjs&#039; <\/p>\n<p>\u6784\u5efa\u6210\u529f\u540e&#xff0c;\u9879\u76ee\u6839\u76ee\u5f55\u4f1a\u751f\u6210\u00a0miniprogram_npm\u00a0\u6587\u4ef6\u5939&#xff0c;\u91cc\u9762\u662f\u7ecf\u8fc7\u8f6c\u6362\u7684 npm \u5305\u3002<\/p>\n<hr \/>\n<h4>\u7b2c\u4e94\u6b65&#xff1a;\u771f\u673a\u8c03\u8bd5 &amp; \u9884\u89c8<\/h4>\n<ul>\n<li>\u5f00\u53d1\u8005\u5de5\u5177\u6a21\u62df\u5668&#xff1a;\u901a\u5e38\u53ef\u76f4\u63a5\u8fd0\u884c<\/li>\n<li>\u771f\u673a\u9884\u89c8\/\u4e0a\u4f20&#xff1a;\u5fc5\u987b\u5148\u6784\u5efa npm&#xff0c;\u5426\u5219\u771f\u673a\u4f1a\u767d\u5c4f\u6216\u62a5\u9519<\/li>\n<\/ul>\n<hr \/>\n<h3>\u56db\u3001\u652f\u6301\u54ea\u4e9b npm \u5305&#xff1f;<\/h3>\n<h4>\u2705 \u63a8\u8350\u4f7f\u7528&#xff08;\u517c\u5bb9\u6027\u597d&#xff09;&#xff1a;<\/h4>\n<table>\n<tr>\u5305\u540d\u7528\u9014<\/tr>\n<tbody>\n<tr>\n<td>dayjs<\/td>\n<td>\u65e5\u671f\u5904\u7406&#xff08;\u6bd4 moment \u8f7b 90%&#xff09;<\/td>\n<\/tr>\n<tr>\n<td>lodash-es<\/td>\n<td>\u5de5\u5177\u51fd\u6570&#xff08;\u9700\u6ce8\u610f tree-shaking&#xff09;<\/td>\n<\/tr>\n<tr>\n<td>uuid<\/td>\n<td>\u751f\u6210\u552f\u4e00 ID<\/td>\n<\/tr>\n<tr>\n<td>qs<\/td>\n<td>URL \u53c2\u6570\u89e3\u6790<\/td>\n<\/tr>\n<tr>\n<td>axios-miniprogram-adapter<\/td>\n<td>\u5728\u5c0f\u7a0b\u5e8f\u4e2d\u4f7f\u7528 axios<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<h4>\u274c \u4e0d\u652f\u6301&#xff08;\u614e\u7528&#xff09;&#xff1a;<\/h4>\n<ul>\n<li>\u4f9d\u8d56\u00a0window\u3001document\u00a0\u7b49\u6d4f\u89c8\u5668 API \u7684\u5305<\/li>\n<li>\u4f9d\u8d56 Node.js \u5185\u7f6e\u6a21\u5757&#xff08;\u5982\u00a0fs,\u00a0crypto&#xff09;<\/li>\n<li>\u4f7f\u7528\u52a8\u6001\u00a0require()\u00a0\u6216\u590d\u6742 Webpack \u914d\u7f6e\u7684\u5e93<\/li>\n<\/ul>\n<p>&#x1f4a1;\u00a0\u6280\u5de7&#xff1a;\u53ef\u5148\u5728\u00a0unpkg.com\u00a0\u67e5\u770b\u5305\u6e90\u7801&#xff0c;\u786e\u8ba4\u65e0\u73af\u5883\u4f9d\u8d56<\/p>\n<hr \/>\n<h3>\u4e94\u3001\u5e38\u89c1\u95ee\u9898\u4e0e\u89e3\u51b3\u65b9\u6848<\/h3>\n<h4>\u274c \u95ee\u9898 1&#xff1a;\u6784\u5efa npm \u540e\u4ecd\u62a5 \u201cmodule not found\u201d<\/h4>\n<p>\u539f\u56e0&#xff1a;<\/p>\n<ul>\n<li>\u672a\u6b63\u786e\u6267\u884c\u201c\u6784\u5efa npm\u201d<\/li>\n<li>\u5f15\u5165\u8def\u5f84\u9519\u8bef<\/li>\n<\/ul>\n<p>\u89e3\u51b3&#xff1a;<\/p>\n<li>\u786e\u4fdd\u00a0miniprogram_npm\u00a0\u6587\u4ef6\u5939\u5b58\u5728<\/li>\n<li>\u5f15\u5165\u65f6\u4e0d\u8981\u52a0\u00a0.js\u00a0\u540e\u7f00&#xff1a; \/\/ \u2705 \u6b63\u786e<br \/>\nimport dayjs from &#039;dayjs&#039;;<\/p>\n<p>\/\/ \u274c \u9519\u8bef<br \/>\nimport dayjs from &#039;dayjs\/index.js&#039;; <\/li>\n<hr \/>\n<h4>\u274c \u95ee\u9898 2&#xff1a;npm \u5305\u4f53\u79ef\u8fc7\u5927&#xff0c;\u5f71\u54cd\u5c0f\u7a0b\u5e8f\u5305\u5927\u5c0f<\/h4>\n<p>\u73b0\u8c61&#xff1a; miniprogram_npm\u00a0\u5360\u7528\u51e0\u767e KB&#xff0c;\u63a5\u8fd1 2MB \u4e3b\u5305\u9650\u5236<\/p>\n<p>\u4f18\u5316\u65b9\u6848&#xff1a;<\/p>\n<li>\u6309\u9700\u5f15\u5165&#xff08;\u4ee5\u00a0lodash\u00a0\u4e3a\u4f8b&#xff09;&#xff1a; \/\/ \u274c \u5168\u91cf\u5f15\u5165&#xff08;\u4e0d\u63a8\u8350&#xff09;<br \/>\nimport _ from &#039;lodash&#039;;<\/p>\n<p>\/\/ \u2705 \u6309\u9700\u5f15\u5165<br \/>\nimport debounce from &#039;lodash\/debounce&#039;;<br \/>\nimport cloneDeep from &#039;lodash\/cloneDeep&#039;; <\/li>\n<li>\u4f7f\u7528\u66f4\u8f7b\u91cf\u66ff\u4ee3\u54c1&#xff08;\u5982\u00a0dayjs\u00a0\u66ff\u4ee3\u00a0moment&#xff09;<\/li>\n<hr \/>\n<h4>\u274c \u95ee\u9898 3&#xff1a;\u4f7f\u7528 TypeScript \u65f6\u62a5\u7c7b\u578b\u9519\u8bef<\/h4>\n<p>\u89e3\u51b3&#xff1a; \u5b89\u88c5\u5bf9\u5e94\u00a0&#064;types&#xff08;\u5982\u679c\u5b58\u5728&#xff09;&#xff1a;<\/p>\n<p>npm install &#064;types\/lodash &#8211;save-dev <\/p>\n<p>\u5e76\u5728\u00a0tsconfig.json\u00a0\u4e2d\u914d\u7f6e&#xff1a;<\/p>\n<p>{<br \/>\n  &#034;compilerOptions&#034;: {<br \/>\n    &#034;baseUrl&#034;: &#034;.&#034;,<br \/>\n    &#034;paths&#034;: {<br \/>\n      &#034;*&#034;: [&#034;miniprogram_npm\/*&#034;]<br \/>\n    }<br \/>\n  }<br \/>\n} <\/p>\n<hr \/>\n<h3>\u516d\u3001\u9ad8\u7ea7\u6280\u5de7&#xff1a;\u53d1\u5e03\u81ea\u5df1\u7684 npm \u7ec4\u4ef6\u5305<\/h3>\n<p>\u5982\u679c\u4f60\u5c01\u88c5\u4e86\u4e00\u5957\u901a\u7528\u7ec4\u4ef6&#xff08;\u5982\u00a0my-ui&#xff09;&#xff0c;\u4e5f\u53ef\u53d1\u5e03\u4e3a npm \u5305\u4f9b\u56e2\u961f\u4f7f\u7528&#xff1a;<\/p>\n<li>\u5728\u7ec4\u4ef6\u5305\u6839\u76ee\u5f55\u6dfb\u52a0\u00a0miniprogram\u00a0\u5b57\u6bb5&#xff08;package.json&#xff09;&#xff1a; {<br \/>\n  &#034;name&#034;: &#034;my-mini-ui&#034;,<br \/>\n  &#034;version&#034;: &#034;1.0.0&#034;,<br \/>\n  &#034;miniprogram&#034;: &#034;dist&#034;  \/\/ \u6307\u5411\u5c0f\u7a0b\u5e8f\u7ec4\u4ef6\u76ee\u5f55<br \/>\n} <\/li>\n<li>\u53d1\u5e03\u5230 npm&#xff1a; npm publish <\/li>\n<li>\u5176\u4ed6\u9879\u76ee\u5b89\u88c5\u540e&#xff0c;\u540c\u6837\u6267\u884c\u00a0\u6784\u5efa npm\u00a0\u5373\u53ef\u4f7f\u7528<\/li>\n<p>&#x1f4cc; \u5b98\u65b9\u6587\u6863&#xff1a;\u5c0f\u7a0b\u5e8f npm \u652f\u6301\u89c4\u8303<\/p>\n<hr \/>\n<h3>\u4e03\u3001\u6700\u4f73\u5b9e\u8df5\u5efa\u8bae<\/h3>\n<li>\u5b9a\u671f\u6e05\u7406\u65e0\u7528\u4f9d\u8d56&#xff1a;npm prune<\/li>\n<li>\u9501\u5b9a\u7248\u672c&#xff1a;\u4f7f\u7528\u00a0package-lock.json\u00a0\u907f\u514d\u4f9d\u8d56\u6f02\u79fb<\/li>\n<li>\u4e3b\u5305\u7626\u8eab&#xff1a;\u5c06 npm \u5305\u653e\u5728\u5206\u5305\u4e2d&#xff08;\u9700\u57fa\u7840\u5e93 \u2265 2.11.0&#xff09;<\/li>\n<li>\u907f\u514d\u6df1\u5c42\u5d4c\u5957\u4f9d\u8d56&#xff1a;\u4f18\u5148\u9009\u62e9\u96f6\u4f9d\u8d56\u7684\u5c0f\u5de5\u5177\u5e93<\/li>\n<hr \/>\n<h3>\u516b\u3001\u7ed3\u8bed<\/h3>\n<p>\u611f\u8c22\u60a8\u7684\u9605\u8bfb&#xff01;\u5982\u679c\u4f60\u6709\u4efb\u4f55\u7591\u95ee\u6216\u60f3\u8981\u5206\u4eab\u7684\u7ecf\u9a8c&#xff0c;\u8bf7\u5728\u8bc4\u8bba\u533a\u7559\u8a00\u4ea4\u6d41&#xff01;<\/p>\n","protected":false},"excerpt":{"rendered":"<p>\u4e00\u3001\u524d\u8a00&#xff1a;\u4e3a\u4ec0\u4e48\u5c0f\u7a0b\u5e8f\u4e5f\u80fd\u7528 npm&#xff1f;<br \/>\n\u4f60\u662f\u5426\u8fd8\u5728&#xff1a;<br \/>\n\u624b\u52a8\u590d\u5236\u00a0lodash\u00a0\u6e90\u7801\u5230\u9879\u76ee\u4e2d&#xff1f;\u81ea\u5df1\u5c01\u88c5\u65e5\u671f\u683c\u5f0f\u5316\u51fd\u6570&#xff1f;\u91cd\u590d\u9020\u8f6e\u5b50\u5904\u7406\u9632\u6296\u3001\u6df1\u62f7\u8d1d\u7b49\u901a\u7528\u903b\u8f91&#xff1f;<br \/>\n\u597d\u6d88\u606f&#xff1a;\u5fae\u4fe1\u5c0f\u7a0b\u5e8f\u81ea\u57fa\u7840\u5e93 2.2.1 \u8d77&#xff0c;\u6b63\u5f0f\u652f\u6301\u4f7f\u7528 npm \u5305&#xff01;<br \/>\n\u901a\u8fc7\u5b98\u65b9\u63d0\u4f9b\u7684\u00a0\u201c\u6784\u5efa npm\u201d\u00a0\u529f\u80fd&#xff0c;\u4f60\u53ef\u4ee5\u50cf\u5728 Vue\/React \u4e2d\u4e00\u6837&#xff0c;\u76f4\u63a5\u00a0np<\/p>\n","protected":false},"author":2,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[1],"tags":[90,556,555],"topic":[],"class_list":["post-69427","post","type-post","status-publish","format-standard","hentry","category-server","tag-npm","tag-556","tag-555"],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v20.3 - https:\/\/yoast.com\/wordpress\/plugins\/seo\/ -->\n<title>\u5fae\u4fe1\u5c0f\u7a0b\u5e8f\u4f7f\u7528 npm \u5305 - \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\/69427.html\" \/>\n<meta property=\"og:locale\" content=\"zh_CN\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"\u5fae\u4fe1\u5c0f\u7a0b\u5e8f\u4f7f\u7528 npm \u5305 - \u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3\" \/>\n<meta property=\"og:description\" content=\"\u4e00\u3001\u524d\u8a00&#xff1a;\u4e3a\u4ec0\u4e48\u5c0f\u7a0b\u5e8f\u4e5f\u80fd\u7528 npm&#xff1f; \u4f60\u662f\u5426\u8fd8\u5728&#xff1a; \u624b\u52a8\u590d\u5236\u00a0lodash\u00a0\u6e90\u7801\u5230\u9879\u76ee\u4e2d&#xff1f;\u81ea\u5df1\u5c01\u88c5\u65e5\u671f\u683c\u5f0f\u5316\u51fd\u6570&#xff1f;\u91cd\u590d\u9020\u8f6e\u5b50\u5904\u7406\u9632\u6296\u3001\u6df1\u62f7\u8d1d\u7b49\u901a\u7528\u903b\u8f91&#xff1f; \u597d\u6d88\u606f&#xff1a;\u5fae\u4fe1\u5c0f\u7a0b\u5e8f\u81ea\u57fa\u7840\u5e93 2.2.1 \u8d77&#xff0c;\u6b63\u5f0f\u652f\u6301\u4f7f\u7528 npm \u5305&#xff01; \u901a\u8fc7\u5b98\u65b9\u63d0\u4f9b\u7684\u00a0\u201c\u6784\u5efa npm\u201d\u00a0\u529f\u80fd&#xff0c;\u4f60\u53ef\u4ee5\u50cf\u5728 Vue\/React \u4e2d\u4e00\u6837&#xff0c;\u76f4\u63a5\u00a0np\" \/>\n<meta property=\"og:url\" content=\"https:\/\/www.wsisp.com\/helps\/69427.html\" \/>\n<meta property=\"og:site_name\" content=\"\u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3\" \/>\n<meta property=\"article:published_time\" content=\"2026-01-31T09:17:08+00:00\" \/>\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\/69427.html\",\"url\":\"https:\/\/www.wsisp.com\/helps\/69427.html\",\"name\":\"\u5fae\u4fe1\u5c0f\u7a0b\u5e8f\u4f7f\u7528 npm \u5305 - \u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3\",\"isPartOf\":{\"@id\":\"https:\/\/www.wsisp.com\/helps\/#website\"},\"datePublished\":\"2026-01-31T09:17:08+00:00\",\"dateModified\":\"2026-01-31T09:17:08+00:00\",\"author\":{\"@id\":\"https:\/\/www.wsisp.com\/helps\/#\/schema\/person\/358e386c577a3ab51c4493330a20ad41\"},\"breadcrumb\":{\"@id\":\"https:\/\/www.wsisp.com\/helps\/69427.html#breadcrumb\"},\"inLanguage\":\"zh-Hans\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\/\/www.wsisp.com\/helps\/69427.html\"]}]},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\/\/www.wsisp.com\/helps\/69427.html#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"\u9996\u9875\",\"item\":\"https:\/\/www.wsisp.com\/helps\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"\u5fae\u4fe1\u5c0f\u7a0b\u5e8f\u4f7f\u7528 npm \u5305\"}]},{\"@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":"\u5fae\u4fe1\u5c0f\u7a0b\u5e8f\u4f7f\u7528 npm \u5305 - \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\/69427.html","og_locale":"zh_CN","og_type":"article","og_title":"\u5fae\u4fe1\u5c0f\u7a0b\u5e8f\u4f7f\u7528 npm \u5305 - \u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3","og_description":"\u4e00\u3001\u524d\u8a00&#xff1a;\u4e3a\u4ec0\u4e48\u5c0f\u7a0b\u5e8f\u4e5f\u80fd\u7528 npm&#xff1f; \u4f60\u662f\u5426\u8fd8\u5728&#xff1a; \u624b\u52a8\u590d\u5236\u00a0lodash\u00a0\u6e90\u7801\u5230\u9879\u76ee\u4e2d&#xff1f;\u81ea\u5df1\u5c01\u88c5\u65e5\u671f\u683c\u5f0f\u5316\u51fd\u6570&#xff1f;\u91cd\u590d\u9020\u8f6e\u5b50\u5904\u7406\u9632\u6296\u3001\u6df1\u62f7\u8d1d\u7b49\u901a\u7528\u903b\u8f91&#xff1f; \u597d\u6d88\u606f&#xff1a;\u5fae\u4fe1\u5c0f\u7a0b\u5e8f\u81ea\u57fa\u7840\u5e93 2.2.1 \u8d77&#xff0c;\u6b63\u5f0f\u652f\u6301\u4f7f\u7528 npm \u5305&#xff01; \u901a\u8fc7\u5b98\u65b9\u63d0\u4f9b\u7684\u00a0\u201c\u6784\u5efa npm\u201d\u00a0\u529f\u80fd&#xff0c;\u4f60\u53ef\u4ee5\u50cf\u5728 Vue\/React \u4e2d\u4e00\u6837&#xff0c;\u76f4\u63a5\u00a0np","og_url":"https:\/\/www.wsisp.com\/helps\/69427.html","og_site_name":"\u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3","article_published_time":"2026-01-31T09:17:08+00:00","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\/69427.html","url":"https:\/\/www.wsisp.com\/helps\/69427.html","name":"\u5fae\u4fe1\u5c0f\u7a0b\u5e8f\u4f7f\u7528 npm \u5305 - \u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3","isPartOf":{"@id":"https:\/\/www.wsisp.com\/helps\/#website"},"datePublished":"2026-01-31T09:17:08+00:00","dateModified":"2026-01-31T09:17:08+00:00","author":{"@id":"https:\/\/www.wsisp.com\/helps\/#\/schema\/person\/358e386c577a3ab51c4493330a20ad41"},"breadcrumb":{"@id":"https:\/\/www.wsisp.com\/helps\/69427.html#breadcrumb"},"inLanguage":"zh-Hans","potentialAction":[{"@type":"ReadAction","target":["https:\/\/www.wsisp.com\/helps\/69427.html"]}]},{"@type":"BreadcrumbList","@id":"https:\/\/www.wsisp.com\/helps\/69427.html#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"\u9996\u9875","item":"https:\/\/www.wsisp.com\/helps"},{"@type":"ListItem","position":2,"name":"\u5fae\u4fe1\u5c0f\u7a0b\u5e8f\u4f7f\u7528 npm \u5305"}]},{"@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\/69427","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=69427"}],"version-history":[{"count":0,"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/posts\/69427\/revisions"}],"wp:attachment":[{"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/media?parent=69427"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/categories?post=69427"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/tags?post=69427"},{"taxonomy":"topic","embeddable":true,"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/topic?post=69427"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}