text: import { _ as _export_sfc, c as createElementBlock, o as openBlock, a as createStaticVNode } from "./app.0a216a24.js";
  const __pageData = '{"title":"npm","description":"","frontmatter":{},"headers":[{"level":2,"title":"\u547D\u4EE4\u5927\u5168","slug":"\u547D\u4EE4\u5927\u5168"},{"level":3,"title":"\u67E5\u770Bnpm\u7248\u672C","slug":"\u67E5\u770Bnpm\u7248\u672C"},{"level":3,"title":"\u955C\u50CF\u64CD\u4F5C","slug":"\u955C\u50CF\u64CD\u4F5C"},{"level":3,"title":"\u4E0B\u8F7D\u6240\u6709\u4F9D\u8D56\u5305","slug":"\u4E0B\u8F7D\u6240\u6709\u4F9D\u8D56\u5305"},{"level":3,"title":"\u4E0B\u8F7D\u5305","slug":"\u4E0B\u8F7D\u5305"},{"level":3,"title":"\u5220\u9664\u5305","slug":"\u5220\u9664\u5305"},{"level":3,"title":"\u5168\u5C40\u5305\u64CD\u4F5C","slug":"\u5168\u5C40\u5305\u64CD\u4F5C"},{"level":3,"title":"\u521B\u5EFApackage.json","slug":"\u521B\u5EFApackage-json"},{"level":3,"title":"\u6E05\u7406\u7F13\u5B58","slug":"\u6E05\u7406\u7F13\u5B58"},{"level":3,"title":"\u4EE3\u7406\u8BBE\u7F6E\u6210\u7A7A","slug":"\u4EE3\u7406\u8BBE\u7F6E\u6210\u7A7A"},{"level":3,"title":"\u672C\u5730\u5B89\u88C5npm\u5305","slug":"\u672C\u5730\u5B89\u88C5npm\u5305"},{"level":3,"title":"\u67E5\u770Bnpm\u914D\u7F6E","slug":"\u67E5\u770Bnpm\u914D\u7F6E"},{"level":2,"title":"nvm","slug":"nvm"},{"level":2,"title":"yarn","slug":"yarn"},{"level":3,"title":"\u5168\u5C40\u5B89\u88C5","slug":"\u5168\u5C40\u5B89\u88C5"},{"level":3,"title":"\u955C\u50CF\u64CD\u4F5C","slug":"\u955C\u50CF\u64CD\u4F5C-1"},{"level":3,"title":"\u4E0B\u8F7D\u6240\u6709\u4F9D\u8D56\u5305","slug":"\u4E0B\u8F7D\u6240\u6709\u4F9D\u8D56\u5305-1"},{"level":3,"title":"\u4E0B\u8F7D\u5305","slug":"\u4E0B\u8F7D\u5305-1"},{"level":3,"title":"\u5168\u5C40\u5B89\u88C5\u4F9D\u8D56\u5305","slug":"\u5168\u5C40\u5B89\u88C5\u4F9D\u8D56\u5305"},{"level":3,"title":"\u5220\u9664\u5305","slug":"\u5220\u9664\u5305-1"},{"level":2,"title":"\u4F7F\u7528cnpm","slug":"\u4F7F\u7528cnpm"},{"level":2,"title":"\u4F7F\u7528pnpm","slug":"\u4F7F\u7528pnpm"},{"level":2,"title":"package.json","slug":"package-json"},{"level":2,"title":"\u53D1\u5E03\u4E0E\u4E0B\u67B6 npm \u5305","slug":"\u53D1\u5E03\u4E0E\u4E0B\u67B6-npm-\u5305"},{"level":2,"title":"\u672C\u5730\u8C03\u8BD5\u7EC4\u4EF6\u5E93","slug":"\u672C\u5730\u8C03\u8BD5\u7EC4\u4EF6\u5E93"},{"level":2,"title":"\u4F9D\u8D56\u5305\u7248\u672C\u53F7~\uFF0C^\u548C*","slug":"\u4F9D\u8D56\u5305\u7248\u672C\u53F7-\uFF0C-\u548C"},{"level":2,"title":"vue add \u548C npm i \u533A\u522B","slug":"vue-add-\u548C-npm-i-\u533A\u522B"},{"level":2,"title":"\u672C\u5730\u8FD0\u884C\u6253\u5305\u540E\u524D\u7AEF\u9879\u76EE","slug":"\u672C\u5730\u8FD0\u884C\u6253\u5305\u540E\u524D\u7AEF\u9879\u76EE"}],"relativePath":"notes/1.basic/5.node/1.npm.md","lastUpdated":1652939653946}';
  const _sfc_main = {};
  const _hoisted_1 = /* @__PURE__ */ createStaticVNode('<h1 id="npm" tabindex="-1">npm <a class="header-anchor" href="#npm" aria-hidden="true">#</a></h1><div class="info custom-block"><p class="custom-block-title">INFO</p><p>npm\u662F\u968F\u540Cnodejs\u4E00\u8D77\u5B89\u88C5\u7684\u5305\u7BA1\u7406\u5DE5\u5177\uFF0C\u80FD\u89E3\u51B3NodeJS\u4EE3\u7801\u90E8\u7F72\u4E0A\u7684\u5F88\u591A\u95EE\u9898\uFF0C\u5E38\u89C1\u7684\u4F7F\u7528\u573A\u666F\u6709\u4EE5\u4E0B\u51E0\u79CD\uFF1A</p><ul><li>\u5141\u8BB8\u7528\u6237\u4ECE<a href="https://www.npmjs.com/" target="_blank" rel="noopener noreferrer">npm\u5E02\u573A</a>\u4E0B\u8F7D\u522B\u4EBA\u7F16\u5199\u7684\u7B2C\u4E09\u65B9\u5305\u5230\u672C\u5730\u9879\u76EE\u4E2D\u4F7F\u7528</li><li>\u5141\u8BB8\u7528\u6237\u4ECE<a href="https://www.npmjs.com/" target="_blank" rel="noopener noreferrer">npm\u5E02\u573A</a>\u4E0B\u8F7D\u5E76\u5B89\u88C5\u522B\u4EBA\u7F16\u5199\u7684\u547D\u4EE4\u884C\u7A0B\u5E8F\u5230\u672C\u5730\u4F7F\u7528</li><li>\u5141\u8BB8\u7528\u6237\u5C06\u81EA\u5DF1\u7F16\u5199\u7684\u5305\u6216\u547D\u4EE4\u884C\u7A0B\u5E8F\u4E0A\u4F20\u5230<a href="https://www.npmjs.com/" target="_blank" rel="noopener noreferrer">npm\u5E02\u573A</a>\u4F9B\u522B\u4EBA\u4F7F\u7528</li></ul><p>\u53EF\u4EE5\u901A\u8FC7\u547D\u4EE4\u884C\u8F93\u5165&quot;npm -v&quot;\u6765\u6D4B\u8BD5\u662F\u5426\u6210\u529F\u5B89\u88C5nodejs</p></div><h2 id="\u547D\u4EE4\u5927\u5168" tabindex="-1">\u547D\u4EE4\u5927\u5168 <a class="header-anchor" href="#\u547D\u4EE4\u5927\u5168" aria-hidden="true">#</a></h2><h3 id="\u67E5\u770Bnpm\u7248\u672C" tabindex="-1">\u67E5\u770Bnpm\u7248\u672C <a class="header-anchor" href="#\u67E5\u770Bnpm\u7248\u672C" aria-hidden="true">#</a></h3><div class="language-sh"><pre><code><span class="line"><span style="color:#A6ACCD;">npm -v</span></span>\n<span class="line"></span></code></pre></div><h3 id="\u955C\u50CF\u64CD\u4F5C" tabindex="-1">\u955C\u50CF\u64CD\u4F5C <a class="header-anchor" href="#\u955C\u50CF\u64CD\u4F5C" aria-hidden="true">#</a></h3><p>\u5207\u6362\u5230\u6DD8\u5B9D\u955C\u50CF\u53EF\u4EE5\u5728\u4E0B\u8F7D\u5F88\u591A\u5305\u65F6\u66F4\u52A0\u5FEB\u901F</p><div class="language-sh"><pre><code><span class="line"><span style="color:#676E95;font-style:italic;"># \u5207\u6362\u6DD8\u5B9D\u955C\u50CF</span></span>\n<span class="line"><span style="color:#A6ACCD;">npm config </span><span style="color:#82AAFF;">set</span><span style="color:#A6ACCD;"> registry http://registry.npm.taobao.org/</span></span>\n<span class="line"><span style="color:#676E95;font-style:italic;"># \u5207\u6362\u56DE\u539F\u5148\u5730\u5740\uFF0C\u6BD4\u5982\u4E0A\u4F20npm\u5305\u65F6\u4E0D\u80FD\u4F7F\u7528\u6DD8\u5B9D\u8DEF\u5F84</span></span>\n<span class="line"><span style="color:#A6ACCD;">npm config </span><span style="color:#82AAFF;">set</span><span style="color:#A6ACCD;"> registry https://registry.npmjs.org/</span></span>\n<span class="line"><span style="color:#676E95;font-style:italic;"># \u67E5\u8BE2\u5F53\u524D\u5730\u5740\u914D\u7F6E</span></span>\n<span class="line"><span style="color:#A6ACCD;">npm get registry</span></span>\n<span class="line"></span></code></pre></div><h3 id="\u4E0B\u8F7D\u6240\u6709\u4F9D\u8D56\u5305" tabindex="-1">\u4E0B\u8F7D\u6240\u6709\u4F9D\u8D56\u5305 <a class="header-anchor" href="#\u4E0B\u8F7D\u6240\u6709\u4F9D\u8D56\u5305" aria-hidden="true">#</a></h3><div class="language-sh"><pre><code><span class="line"><span style="color:#A6ACCD;">npm install</span></span>\n<span class="line"><span style="color:#676E95;font-style:italic;"># \u4E0A\u65B9\u7B80\u5199</span></span>\n<span class="line"><span style="color:#A6ACCD;">npm i </span></span>\n<span class="line"></span></code></pre></div><h3 id="\u4E0B\u8F7D\u5305" tabindex="-1">\u4E0B\u8F7D\u5305 <a class="header-anchor" href="#\u4E0B\u8F7D\u5305" aria-hidden="true">#</a></h3><p>\u7528\u4E8E\u5F00\u53D1\u73AF\u5883\u4E0E\u6253\u5305\u73AF\u5883\u7684\u5305</p><div class="language-sh"><pre><code><span class="line"><span style="color:#A6ACCD;">npm install --save package</span></span>\n<span class="line"><span style="color:#676E95;font-style:italic;"># \u4E0A\u65B9\u7B80\u5199</span></span>\n<span class="line"><span style="color:#A6ACCD;">npm i -s package</span></span>\n<span class="line"></span></code></pre></div><p>\u53EA\u7528\u4E8E\u5F00\u53D1\u73AF\u5883\uFF0C\u4E0D\u7528\u4E8E\u6253\u5305\u73AF\u5883\u7684\u5305</p><div class="language-sh"><pre><code><span class="line"><span style="color:#A6ACCD;">npm install --save-dev package</span></span>\n<span class="line"><span style="color:#676E95;font-style:italic;"># \u4E0A\u65B9\u7B80\u5199</span></span>\n<span class="line"><span style="color:#A6ACCD;">npm i -D package</span></span>\n<span class="line"></span></code></pre></div><h3 id="\u5220\u9664\u5305" tabindex="-1">\u5220\u9664\u5305 <a class="header-anchor" href="#\u5220\u9664\u5305" aria-hidden="true">#</a></h3><div class="language-sh"><pre><code><span class="line"><span style="color:#A6ACCD;">npm uninstall package</span></span>\n<span class="line"></span></code></pre></div><h3 id="\u5168\u5C40\u5305\u64CD\u4F5C" tabindex="-1">\u5168\u5C40\u5305\u64CD\u4F5C <a class="header-anchor" href="#\u5168\u5C40\u5305\u64CD\u4F5C" aria-hidden="true">#</a></h3><div class="language-sh"><pre><code><span class="line"><span style="color:#676E95;font-style:italic;"># \u5168\u5C40\u5B89\u88C5\u5305</span></span>\n<span class="line"><span style="color:#A6ACCD;">npm i -g package</span></span>\n<span class="line"><span style="color:#676E95;font-style:italic;"># \u67E5\u770B\u5168\u5C40\u5B89\u88C5\u5305</span></span>\n<span class="line"><span style="color:#A6ACCD;">npm list -g --depth 0</span></span>\n<span class="line"><span style="color:#676E95;font-style:italic;"># \u5378\u8F7D\u5168\u5C40\u5B89\u88C5\u5305</span></span>\n<span class="line"><span style="color:#A6ACCD;">npm uninstall -g package</span></span>\n<span class="line"></span></code></pre></div><h3 id="\u521B\u5EFApackage-json" tabindex="-1">\u521B\u5EFApackage.json <a class="header-anchor" href="#\u521B\u5EFApackage-json" aria-hidden="true">#</a></h3><div class="language-sh"><pre><code><span class="line"><span style="color:#676E95;font-style:italic;"># \u4F7F\u7528\u8F93\u5165\u7684\u65B9\u5F0F\u521D\u59CB\u5316\u914D\u7F6Epackage.json</span></span>\n<span class="line"><span style="color:#A6ACCD;">npm init</span></span>\n<span class="line"><span style="color:#676E95;font-style:italic;"># \u4F7F\u7528\u9ED8\u8BA4\u53C2\u6570\u521B\u5EFApackage.json\u6587\u4EF6</span></span>\n<span class="line"><span style="color:#A6ACCD;">npm init --yes</span></span>\n<span class="line"><span style="color:#676E95;font-style:italic;"># \u4E0A\u65B9\u7B80\u5199</span></span>\n<span class="line"><span style="color:#A6ACCD;">npm init -y</span></span>\n<span class="line"></span></code></pre></div><h3 id="\u6E05\u7406\u7F13\u5B58" tabindex="-1">\u6E05\u7406\u7F13\u5B58 <a class="header-anchor" href="#\u6E05\u7406\u7F13\u5B58" aria-hidden="true">#</a></h3><div class="language-sh"><pre><code><span class="line"><span style="color:#A6ACCD;">npm cache clean --force</span></span>\n<span class="line"></span></code></pre></div><h3 id="\u4EE3\u7406\u8BBE\u7F6E\u6210\u7A7A" tabindex="-1">\u4EE3\u7406\u8BBE\u7F6E\u6210\u7A7A <a class="header-anchor" href="#\u4EE3\u7406\u8BBE\u7F6E\u6210\u7A7A" aria-hidden="true">#</a></h3><p>\u7528\u4E8E\u89E3\u51B3\u4E00\u4E9B\u8F6F\u4EF6\u4F1A\u81EA\u52A8\u7ED9npm\u6DFB\u52A0\u4EE3\u7406\uFF0C\u5BFC\u81F4npm\u65E0\u6CD5\u6B63\u5E38\u4F7F\u7528\uFF0C\u4E4B\u540E\u4E0D\u9700\u8981\u4F7F\u7528\u8FD9\u4E9B\u8F6F\u4EF6\u65F6\u5C31\u9700\u8981\u4EE3\u7406\u8BBE\u7F6E\u6210\u7A7A</p><div class="language-sh"><pre><code><span class="line"><span style="color:#A6ACCD;">npm config </span><span style="color:#82AAFF;">set</span><span style="color:#A6ACCD;"> proxy null</span></span>\n<span class="line"><span style="color:#A6ACCD;">npm config </span><span style="color:#82AAFF;">set</span><span style="color:#A6ACCD;"> https-proxy null</span></span>\n<span class="line"><span style="color:#676E95;font-style:italic;"># \u6216\u8005</span></span>\n<span class="line"><span style="color:#A6ACCD;">npm config delete proxy</span></span>\n<span class="line"><span style="color:#A6ACCD;">npm config delete https-proxy</span></span>\n<span class="line"></span></code></pre></div><h3 id="\u672C\u5730\u5B89\u88C5npm\u5305" tabindex="-1">\u672C\u5730\u5B89\u88C5npm\u5305 <a class="header-anchor" href="#\u672C\u5730\u5B89\u88C5npm\u5305" aria-hidden="true">#</a></h3><div class="language-sh"><pre><code><span class="line"><span style="color:#A6ACCD;">npm link</span></span>\n<span class="line"><span style="color:#676E95;font-style:italic;"># \u5982\u679C\u5DF2\u7ECFnpm link\u8FC7,\u5F88\u53EF\u80FD\u4F1A\u62A5\u9519\uFF0C\u8FD9\u65F6\u53EF\u4EE5\u6DFB\u52A0-forcec\u53C2\u6570\uFF0C\u8986\u76D6\u4E0A\u4E00\u6B21\u7684link</span></span>\n<span class="line"><span style="color:#A6ACCD;">npm link -f</span></span>\n<span class="line"></span></code></pre></div><h3 id="\u67E5\u770Bnpm\u914D\u7F6E" tabindex="-1">\u67E5\u770Bnpm\u914D\u7F6E <a class="header-anchor" href="#\u67E5\u770Bnpm\u914D\u7F6E" aria-hidden="true">#</a></h3><div class="language-sh"><pre><code><span class="line"><span style="color:#A6ACCD;">npm config list</span></span>\n<span class="line"></span></code></pre></div><h2 id="nvm" tabindex="-1">nvm <a class="header-anchor" href="#nvm" aria-hidden="true">#</a></h2><p>nvm \u662F node \u7248\u672C\u7BA1\u7406\u5DE5\u5177\uFF0C\u53EF\u7528\u4E8E\u5207\u6362node\u7248\u672C</p><div class="language-sh"><pre><code><span class="line"><span style="color:#676E95;font-style:italic;"># \u67E5\u770Bnode\u7248\u672C\u5217\u8868</span></span>\n<span class="line"><span style="color:#A6ACCD;">nvm ls</span></span>\n<span class="line"><span style="color:#676E95;font-style:italic;"># \u4E0B\u8F7D\u6307\u5B9Anode\u7248\u672C</span></span>\n<span class="line"><span style="color:#A6ACCD;">nvm install \u7248\u672C\u53F7</span></span>\n<span class="line"><span style="color:#676E95;font-style:italic;"># \u4F7F\u7528\u6307\u5B9Anode\u7248\u672C</span></span>\n<span class="line"><span style="color:#A6ACCD;">nvm use \u7248\u672C\u53F7</span></span>\n<span class="line"><span style="color:#676E95;font-style:italic;"># \u5220\u9664node\u6307\u5B9A\u7248\u672C</span></span>\n<span class="line"><span style="color:#A6ACCD;">nvm uninstall \u7248\u672C\u53F7</span></span>\n<span class="line"></span></code></pre></div><h2 id="yarn" tabindex="-1">yarn <a class="header-anchor" href="#yarn" aria-hidden="true">#</a></h2><div class="info custom-block"><p class="custom-block-title">INFO</p><p>yarn\u53EF\u4EE5\u770B\u4F5C\u66F4\u4F18\u79C0\u7684npm\u547D\u4EE4</p></div><h3 id="\u5168\u5C40\u5B89\u88C5" tabindex="-1">\u5168\u5C40\u5B89\u88C5 <a class="header-anchor" href="#\u5168\u5C40\u5B89\u88C5" aria-hidden="true">#</a></h3><div class="language-sh"><pre><code><span class="line"><span style="color:#A6ACCD;">npm i -g yarn</span></span>\n<span class="line"></span></code></pre></div><h3 id="\u955C\u50CF\u64CD\u4F5C-1" tabindex="-1">\u955C\u50CF\u64CD\u4F5C <a class="header-anchor" href="#\u955C\u50CF\u64CD\u4F5C-1" aria-hidden="true">#</a></h3><div class="language-sh"><pre><code><span class="line"><span style="color:#676E95;font-style:italic;"># \u67E5\u8BE2\u5F53\u524D\u5730\u5740\u914D\u7F6E</span></span>\n<span class="line"><span style="color:#A6ACCD;">yarn config get registry</span></span>\n<span class="line"><span style="color:#676E95;font-style:italic;"># \u5207\u6362\u6DD8\u5B9D\u955C\u50CF</span></span>\n<span class="line"><span style="color:#A6ACCD;">yarn config </span><span style="color:#82AAFF;">set</span><span style="color:#A6ACCD;"> registry http://registry.npm.taobao.org/</span></span>\n<span class="line"><span style="color:#676E95;font-style:italic;"># \u5207\u6362\u56DE\u539F\u5148\u5730\u5740</span></span>\n<span class="line"><span style="color:#A6ACCD;">yarn config </span><span style="color:#82AAFF;">set</span><span style="color:#A6ACCD;"> registry https://registry.npmjs.org/</span></span>\n<span class="line"></span></code></pre></div><h3 id="\u4E0B\u8F7D\u6240\u6709\u4F9D\u8D56\u5305-1" tabindex="-1">\u4E0B\u8F7D\u6240\u6709\u4F9D\u8D56\u5305 <a class="header-anchor" href="#\u4E0B\u8F7D\u6240\u6709\u4F9D\u8D56\u5305-1" aria-hidden="true">#</a></h3><div class="language-"><pre><code>yarn\n</code></pre></div><h3 id="\u4E0B\u8F7D\u5305-1" tabindex="-1">\u4E0B\u8F7D\u5305 <a class="header-anchor" href="#\u4E0B\u8F7D\u5305-1" aria-hidden="true">#</a></h3><div class="language-sh"><pre><code><span class="line"><span style="color:#676E95;font-style:italic;"># \u4E0B\u8F7D\u7528\u4E8E\u7528\u4E8E\u5F00\u53D1\u73AF\u5883\u4E0E\u6253\u5305\u73AF\u5883\u7684\u5305</span></span>\n<span class="line"><span style="color:#A6ACCD;">yarn add package</span></span>\n<span class="line"><span style="color:#676E95;font-style:italic;"># \u4E0B\u8F7D\u7528\u4E8E\u4EC5\u7528\u4E8E\u5F00\u53D1\u73AF\u5883\u7684\u5305</span></span>\n<span class="line"><span style="color:#A6ACCD;">yarn add --dev package</span></span>\n<span class="line"><span style="color:#676E95;font-style:italic;"># \u4E0A\u65B9\u7B80\u5199</span></span>\n<span class="line"><span style="color:#A6ACCD;">yarn add -D package</span></span>\n<span class="line"></span></code></pre></div><h3 id="\u5168\u5C40\u5B89\u88C5\u4F9D\u8D56\u5305" tabindex="-1">\u5168\u5C40\u5B89\u88C5\u4F9D\u8D56\u5305 <a class="header-anchor" href="#\u5168\u5C40\u5B89\u88C5\u4F9D\u8D56\u5305" aria-hidden="true">#</a></h3><div class="language-sh"><pre><code><span class="line"><span style="color:#A6ACCD;">yarn global add package</span></span>\n<span class="line"></span></code></pre></div><h3 id="\u5220\u9664\u5305-1" tabindex="-1">\u5220\u9664\u5305 <a class="header-anchor" href="#\u5220\u9664\u5305-1" aria-hidden="true">#</a></h3><div class="language-sh"><pre><code><span class="line"><span style="color:#A6ACCD;">yarn remove package</span></span>\n<span class="line"></span></code></pre></div><h2 id="\u4F7F\u7528cnpm" tabindex="-1">\u4F7F\u7528cnpm <a class="header-anchor" href="#\u4F7F\u7528cnpm" aria-hidden="true">#</a></h2><p>\u65B9\u6CD5\u4E00</p><div class="language-sh"><pre><code><span class="line"><span style="color:#A6ACCD;">npm install -g cnpm</span></span>\n<span class="line"><span style="color:#A6ACCD;">cnpm config </span><span style="color:#82AAFF;">set</span><span style="color:#A6ACCD;"> registry https://registry.npm.taobao.org</span></span>\n<span class="line"></span></code></pre></div><p>\u65B9\u6CD5\u4E8C</p><div class="language-sh"><pre><code><span class="line"><span style="color:#A6ACCD;">npm install -g cnpm --registry=https://registry.npm.taobao.org</span></span>\n<span class="line"></span></code></pre></div><h2 id="\u4F7F\u7528pnpm" tabindex="-1">\u4F7F\u7528pnpm <a class="header-anchor" href="#\u4F7F\u7528pnpm" aria-hidden="true">#</a></h2><p>pnpm \u662F\u4E00\u4E2A\u5305\u7BA1\u7406\u5668\uFF0C\u8FD9\u4E00\u70B9\u8DDF npm/yarn \u6CA1\u6709\u533A\u522B\uFF0C\u4F46\u5B83\u4F5C\u4E3A\u6740\u624B\u950F\u7684\u4E24\u4E2A\u4F18\u52BF\u5728\u4E8E:</p><ul><li>\u5305\u5B89\u88C5\u901F\u5EA6\u6781\u5FEB;</li><li>\u78C1\u76D8\u7A7A\u95F4\u5229\u7528\u975E\u5E38\u9AD8\u6548</li></ul><div class="language-sh"><pre><code><span class="line"><span style="color:#A6ACCD;">npm i -g pnpm</span></span>\n<span class="line"></span></code></pre></div><p>\u4F5C\u8005Zoltan Kochan\u8BA4\u4E3A\uFF0Cyarn\u53EA\u662F\u5BF9npm\u505A\u4E86\u4E9B\u5FAE\u6539\u8FDB\uFF0C\u63D0\u5347\u4E86\u901F\u5EA6\u3001\u589E\u52A0\u4E86\u4E00\u4E9B\u5C5E\u6027\uFF0C\u4F46\u5E76\u6CA1\u6709\u6539\u53D8npm\u7684\u6241\u5E73\u5316\u4F9D\u8D56\u7ED3\u6784\u3002\u800C\u6241\u5E73\u5316\u7ED3\u6784\u81EA\u5E26\u4EE5\u4E0B\u95EE\u9898\uFF1A</p><ol><li>\u6A21\u5757\u53EF\u4EE5\u8BBF\u95EE\u81EA\u8EAB\u5E76\u4E0D\u4F9D\u8D56\u7684\u5305</li><li>\u4F9D\u8D56\u6811\u7684\u6241\u5E73\u5316\u7B97\u6CD5\u76F8\u5F53\u590D\u6742</li><li>\u6709\u4E00\u4E9B\u5305\u4E0D\u5F97\u4E0D\u62F7\u8D1D\u8FDB\u9879\u76EE\u7684node_modules\u76EE\u5F55</li></ol><p>Zoltan Kochan\u5BF9pnpm\u7684\u7814\u53D1\u6295\u5165\u4E86\u66F4\u591A\u7684\u65F6\u95F4\uFF0Cpnpm\u53D6\u5F97\u4E86\u6210\u529F\uFF0C\u56CA\u62EC\u4E86yarn\u6240\u6709\u589E\u52A0\u7684\u5C5E\u6027\uFF1A</p><ol><li>\u5B89\u5168\uFF1A\u4EE3\u7801\u6267\u884C\u524D\u5BF9\u5176\u8FDB\u884C\u68C0\u67E5\uFF0C\u4EE5\u786E\u4FDD\u4F9D\u8D56\u5B89\u88C5\u7684\u5B8C\u6574\u6027</li><li>\u79BB\u7EBF\u6A21\u5F0F\uFF1Apnpm\u5C06\u6240\u6709\u5DF2\u4E0B\u8F7D\u5305\u7684\u538B\u7F29\u6587\u4EF6\u4FDD\u5B58\u5728\u672C\u5730\u955C\u50CF\u4ED3\u5E93\uFF0C\u4EE5\u5B9E\u73B0\u79BB\u7EBF\u4F7F\u7528\uFF0C\u53EA\u9700\u8981\u914D\u7F6E--offline\u53C2\u6570</li><li>\u5FEB\u901F\uFF1Apnpm\u901F\u5EA6\u5927\u6982\u662Fnpm\u548Cyarn\u76841/3\u5DE6\u53F3\u3002\u56E0\u4E3Ayarn\u9700\u8981\u62F7\u8D1D\u5305\uFF0C\u800C pnpm\u53EA\u9700\u8981\u628A\u5305\u5B58\u5728\u5168\u5C40\u4ED3\u5E93\uFF0C\u4EFB\u4F55\u9700\u8981\u7684\u5730\u65B9\u6307\u5411\u5B83\u5373\u53EF</li></ol><div class="language-sh"><pre><code><span class="line"><span style="color:#676E95;font-style:italic;"># \u5168\u5C40\u5B89\u88C5</span></span>\n<span class="line"><span style="color:#A6ACCD;">pnpm add </span><span style="color:#89DDFF;">&lt;</span><span style="color:#A6ACCD;">packageName</span><span style="color:#89DDFF;">&gt;</span><span style="color:#A6ACCD;"> -g</span></span>\n<span class="line"><span style="color:#676E95;font-style:italic;"># \u67E5\u8BE2\u5F53\u524D\u5730\u5740\u914D\u7F6E</span></span>\n<span class="line"><span style="color:#A6ACCD;">pnpm config get registry</span></span>\n<span class="line"><span style="color:#676E95;font-style:italic;"># \u5207\u6362\u6DD8\u5B9D\u955C\u50CF</span></span>\n<span class="line"><span style="color:#A6ACCD;">pnpm config </span><span style="color:#82AAFF;">set</span><span style="color:#A6ACCD;"> registry http://registry.npm.taobao.org/</span></span>\n<span class="line"><span style="color:#676E95;font-style:italic;"># \u5207\u6362\u56DE\u539F\u5148\u5730\u5740</span></span>\n<span class="line"><span style="color:#A6ACCD;">pnpm config </span><span style="color:#82AAFF;">set</span><span style="color:#A6ACCD;"> registry https://registry.npmjs.org/</span></span>\n<span class="line"></span></code></pre></div><h2 id="package-json" tabindex="-1">package.json <a class="header-anchor" href="#package-json" aria-hidden="true">#</a></h2><p>package.json \u662F\u4E00\u4E2A\u8BB0\u5F55\u6587\u4EF6\uFF0Cnpm \u501F\u7531\u8FD9\u4E2A\u8BB0\u5F55\u6587\u4EF6\u5BF9\u4F9D\u8D56\u5305\u8FDB\u884C\u7BA1\u7406</p><div class="language-json"><pre><code><span class="line"><span style="color:#89DDFF;">{</span></span>\n<span class="line"><span style="color:#A6ACCD;">  </span><span style="color:#89DDFF;">&quot;</span><span style="color:#C792EA;">name</span><span style="color:#89DDFF;">&quot;</span><span style="color:#89DDFF;">:</span><span style="color:#A6ACCD;"> </span><span style="color:#89DDFF;">&quot;</span><span style="color:#C3E88D;">vue-esign</span><span style="color:#89DDFF;">&quot;</span><span style="color:#89DDFF;">,</span><span style="color:#A6ACCD;"> </span><span style="color:#676E95;font-style:italic;">// \u5305\u540D</span></span>\n<span class="line"><span style="color:#A6ACCD;">  </span><span style="color:#89DDFF;">&quot;</span><span style="color:#C792EA;">description</span><span style="color:#89DDFF;">&quot;</span><span style="color:#89DDFF;">:</span><span style="color:#A6ACCD;"> </span><span style="color:#89DDFF;">&quot;</span><span style="color:#C3E88D;">A canvas signature component of vue</span><span style="color:#89DDFF;">&quot;</span><span style="color:#89DDFF;">,</span><span style="color:#A6ACCD;"> </span><span style="color:#676E95;font-style:italic;">// \u63CF\u8FF0</span></span>\n<span class="line"><span style="color:#A6ACCD;">  </span><span style="color:#89DDFF;">&quot;</span><span style="color:#C792EA;">version</span><span style="color:#89DDFF;">&quot;</span><span style="color:#89DDFF;">:</span><span style="color:#A6ACCD;"> </span><span style="color:#89DDFF;">&quot;</span><span style="color:#C3E88D;">1.0.5</span><span style="color:#89DDFF;">&quot;</span><span style="color:#89DDFF;">,</span><span style="color:#A6ACCD;"> </span><span style="color:#676E95;font-style:italic;">// \u7248\u672C\u53F7</span></span>\n<span class="line"><span style="color:#A6ACCD;">  </span><span style="color:#89DDFF;">&quot;</span><span style="color:#C792EA;">author</span><span style="color:#89DDFF;">&quot;</span><span style="color:#89DDFF;">:</span><span style="color:#A6ACCD;"> </span><span style="color:#89DDFF;">&quot;</span><span style="color:#C3E88D;">JaimeCheng &lt;403693553@qq.com&gt;</span><span style="color:#89DDFF;">&quot;</span><span style="color:#89DDFF;">,</span><span style="color:#A6ACCD;"> </span><span style="color:#676E95;font-style:italic;">// \u4F5C\u8005</span></span>\n<span class="line"><span style="color:#A6ACCD;">  </span><span style="color:#89DDFF;">&quot;</span><span style="color:#C792EA;">license</span><span style="color:#89DDFF;">&quot;</span><span style="color:#89DDFF;">:</span><span style="color:#A6ACCD;"> </span><span style="color:#89DDFF;">&quot;</span><span style="color:#C3E88D;">MIT</span><span style="color:#89DDFF;">&quot;</span><span style="color:#89DDFF;">,</span><span style="color:#A6ACCD;"> </span><span style="color:#676E95;font-style:italic;">// MIT\u662F\u8F83\u5BBD\u677E\u7684\u5F00\u6E90\u8BB8\u53EF\u8BC1</span></span>\n<span class="line"><span style="color:#A6ACCD;">  </span><span style="color:#89DDFF;">&quot;</span><span style="color:#C792EA;">main</span><span style="color:#89DDFF;">&quot;</span><span style="color:#89DDFF;">:</span><span style="color:#A6ACCD;"> </span><span style="color:#89DDFF;">&quot;</span><span style="color:#C3E88D;">dist/index.js</span><span style="color:#89DDFF;">&quot;</span><span style="color:#89DDFF;">,</span><span style="color:#A6ACCD;"> </span><span style="color:#676E95;font-style:italic;">// \u4E3B\u6587\u4EF6</span></span>\n<span class="line"><span style="color:#A6ACCD;">  </span><span style="color:#89DDFF;">&quot;</span><span style="color:#C792EA;">private</span><span style="color:#89DDFF;">&quot;</span><span style="color:#89DDFF;">:</span><span style="color:#A6ACCD;"> </span><span style="color:#89DDFF;">false,</span><span style="color:#A6ACCD;"> </span><span style="color:#676E95;font-style:italic;">// \u5F00\u6E90</span></span>\n<span class="line"><span style="color:#A6ACCD;">  </span><span style="color:#89DDFF;">&quot;</span><span style="color:#C792EA;">scripts</span><span style="color:#89DDFF;">&quot;</span><span style="color:#89DDFF;">:</span><span style="color:#A6ACCD;"> </span><span style="color:#89DDFF;">{</span></span>\n<span class="line"><span style="color:#A6ACCD;">    </span><span style="color:#89DDFF;">&quot;</span><span style="color:#FFCB6B;">dev</span><span style="color:#89DDFF;">&quot;</span><span style="color:#89DDFF;">:</span><span style="color:#A6ACCD;"> </span><span style="color:#89DDFF;">&quot;</span><span style="color:#C3E88D;">cross-env NODE_ENV=development webpack-dev-server --open --hot</span><span style="color:#89DDFF;">&quot;</span><span style="color:#89DDFF;">,</span></span>\n<span class="line"><span style="color:#A6ACCD;">    </span><span style="color:#89DDFF;">&quot;</span><span style="color:#FFCB6B;">build</span><span style="color:#89DDFF;">&quot;</span><span style="color:#89DDFF;">:</span><span style="color:#A6ACCD;"> </span><span style="color:#89DDFF;">&quot;</span><span style="color:#C3E88D;">cross-env NODE_ENV=production webpack --progress --hide-modules</span><span style="color:#89DDFF;">&quot;</span></span>\n<span class="line"><span style="color:#A6ACCD;">  </span><span style="color:#89DDFF;">},</span></span>\n<span class="line"><span style="color:#A6ACCD;">  </span><span style="color:#89DDFF;">&quot;</span><span style="color:#C792EA;">repository</span><span style="color:#89DDFF;">&quot;</span><span style="color:#89DDFF;">:</span><span style="color:#A6ACCD;"> </span><span style="color:#89DDFF;">{</span></span>\n<span class="line"><span style="color:#A6ACCD;">    </span><span style="color:#676E95;font-style:italic;">// \u4ED3\u5E93\u5730\u5740</span></span>\n<span class="line"><span style="color:#A6ACCD;">    </span><span style="color:#89DDFF;">&quot;</span><span style="color:#FFCB6B;">type</span><span style="color:#89DDFF;">&quot;</span><span style="color:#89DDFF;">:</span><span style="color:#A6ACCD;"> </span><span style="color:#89DDFF;">&quot;</span><span style="color:#C3E88D;">git</span><span style="color:#89DDFF;">&quot;</span><span style="color:#89DDFF;">,</span></span>\n<span class="line"><span style="color:#A6ACCD;">    </span><span style="color:#89DDFF;">&quot;</span><span style="color:#FFCB6B;">url</span><span style="color:#89DDFF;">&quot;</span><span style="color:#89DDFF;">:</span><span style="color:#A6ACCD;"> </span><span style="color:#89DDFF;">&quot;</span><span style="color:#C3E88D;">https://github.com/JaimeCheng/vue-esign</span><span style="color:#89DDFF;">&quot;</span></span>\n<span class="line"><span style="color:#A6ACCD;">  </span><span style="color:#89DDFF;">},</span></span>\n<span class="line"><span style="color:#A6ACCD;">  </span><span style="color:#89DDFF;">&quot;</span><span style="color:#C792EA;">bugs</span><span style="color:#89DDFF;">&quot;</span><span style="color:#89DDFF;">:</span><span style="color:#A6ACCD;"> </span><span style="color:#89DDFF;">{</span></span>\n<span class="line"><span style="color:#A6ACCD;">    </span><span style="color:#89DDFF;">&quot;</span><span style="color:#FFCB6B;">url</span><span style="color:#89DDFF;">&quot;</span><span style="color:#89DDFF;">:</span><span style="color:#A6ACCD;"> </span><span style="color:#89DDFF;">&quot;</span><span style="color:#C3E88D;">https://github.com/JaimeCheng/vue-esign/issues</span><span style="color:#89DDFF;">&quot;</span></span>\n<span class="line"><span style="color:#A6ACCD;">  </span><span style="color:#89DDFF;">},</span></span>\n<span class="line"><span style="color:#A6ACCD;">  </span><span style="color:#89DDFF;">&quot;</span><span style="color:#C792EA;">homepage</span><span style="color:#89DDFF;">&quot;</span><span style="color:#89DDFF;">:</span><span style="color:#A6ACCD;"> </span><span style="color:#89DDFF;">&quot;</span><span style="color:#C3E88D;">https://git.io/JemnO</span><span style="color:#89DDFF;">&quot;</span><span style="color:#89DDFF;">,</span><span style="color:#A6ACCD;"> </span><span style="color:#676E95;font-style:italic;">// \u4E3B\u9875</span></span>\n<span class="line"><span style="color:#A6ACCD;">  </span><span style="color:#89DDFF;">&quot;</span><span style="color:#C792EA;">keywords</span><span style="color:#89DDFF;">&quot;</span><span style="color:#89DDFF;">:</span><span style="color:#A6ACCD;"> </span><span style="color:#89DDFF;">[</span></span>\n<span class="line"><span style="color:#A6ACCD;">    </span><span style="color:#676E95;font-style:italic;">// \u5173\u952E\u8BCD\uFF0C\u7528\u4E8Enpm\u5E02\u573A\u641C\u7D22</span></span>\n<span class="line"><span style="color:#A6ACCD;">    </span><span style="color:#89DDFF;">&quot;</span><span style="color:#C3E88D;">vue</span><span style="color:#89DDFF;">&quot;</span><span style="color:#89DDFF;">,</span></span>\n<span class="line"><span style="color:#A6ACCD;">    </span><span style="color:#89DDFF;">&quot;</span><span style="color:#C3E88D;">component</span><span style="color:#89DDFF;">&quot;</span><span style="color:#89DDFF;">,</span></span>\n<span class="line"><span style="color:#A6ACCD;">    </span><span style="color:#89DDFF;">&quot;</span><span style="color:#C3E88D;">e-sign</span><span style="color:#89DDFF;">&quot;</span><span style="color:#89DDFF;">,</span></span>\n<span class="line"><span style="color:#A6ACCD;">    </span><span style="color:#89DDFF;">&quot;</span><span style="color:#C3E88D;">signature</span><span style="color:#89DDFF;">&quot;</span><span style="color:#89DDFF;">,</span></span>\n<span class="line"><span style="color:#A6ACCD;">    </span><span style="color:#89DDFF;">&quot;</span><span style="color:#C3E88D;">canvas</span><span style="color:#89DDFF;">&quot;</span></span>\n<span class="line"><span style="color:#A6ACCD;">  </span><span style="color:#89DDFF;">],</span></span>\n<span class="line"><span style="color:#A6ACCD;">  </span><span style="color:#89DDFF;">&quot;</span><span style="color:#C792EA;">dependencies</span><span style="color:#89DDFF;">&quot;</span><span style="color:#89DDFF;">:</span><span style="color:#A6ACCD;"> </span><span style="color:#89DDFF;">{</span></span>\n<span class="line"><span style="color:#A6ACCD;">    </span><span style="color:#676E95;font-style:italic;">// \u4F9D\u8D56</span></span>\n<span class="line"><span style="color:#A6ACCD;">    </span><span style="color:#89DDFF;">&quot;</span><span style="color:#FFCB6B;">vue</span><span style="color:#89DDFF;">&quot;</span><span style="color:#89DDFF;">:</span><span style="color:#A6ACCD;"> </span><span style="color:#89DDFF;">&quot;</span><span style="color:#C3E88D;">^2.5.11</span><span style="color:#89DDFF;">&quot;</span></span>\n<span class="line"><span style="color:#A6ACCD;">  </span><span style="color:#89DDFF;">},</span></span>\n<span class="line"><span style="color:#A6ACCD;">  </span><span style="color:#89DDFF;">&quot;</span><span style="color:#C792EA;">browserslist</span><span style="color:#89DDFF;">&quot;</span><span style="color:#89DDFF;">:</span><span style="color:#A6ACCD;"> </span><span style="color:#89DDFF;">[</span></span>\n<span class="line"><span style="color:#A6ACCD;">    </span><span style="color:#676E95;font-style:italic;">// \u76EE\u6807\u6D4F\u89C8\u5668\u914D\u7F6E\u8868\uFF0C\u6839\u636E\u63D0\u4F9B\u7684\u76EE\u6807\u6D4F\u89C8\u5668\u7684\u73AF\u5883\u6765\uFF0C\u667A\u80FD\u6DFB\u52A0css\u524D\u7F00\uFF0Cjs\u7684polyfill\u57AB\u7247,\u6765\u517C\u5BB9\u65E7\u7248\u672C\u6D4F\u89C8\u5668</span></span>\n<span class="line"><span style="color:#A6ACCD;">    </span><span style="color:#89DDFF;">&quot;</span><span style="color:#C3E88D;">&gt; 1%</span><span style="color:#89DDFF;">&quot;</span><span style="color:#89DDFF;">,</span></span>\n<span class="line"><span style="color:#A6ACCD;">    </span><span style="color:#89DDFF;">&quot;</span><span style="color:#C3E88D;">last 2 versions</span><span style="color:#89DDFF;">&quot;</span><span style="color:#89DDFF;">,</span></span>\n<span class="line"><span style="color:#A6ACCD;">    </span><span style="color:#89DDFF;">&quot;</span><span style="color:#C3E88D;">not ie &lt;= 8</span><span style="color:#89DDFF;">&quot;</span></span>\n<span class="line"><span style="color:#A6ACCD;">  </span><span style="color:#89DDFF;">],</span></span>\n<span class="line"><span style="color:#A6ACCD;">  </span><span style="color:#89DDFF;">&quot;</span><span style="color:#C792EA;">devDependencies</span><span style="color:#89DDFF;">&quot;</span><span style="color:#89DDFF;">:</span><span style="color:#A6ACCD;"> </span><span style="color:#89DDFF;">{</span></span>\n<span class="line"><span style="color:#A6ACCD;">    </span><span style="color:#676E95;font-style:italic;">// \u5F00\u53D1\u4F9D\u8D56</span></span>\n<span class="line"><span style="color:#A6ACCD;">    </span><span style="color:#89DDFF;">&quot;</span><span style="color:#FFCB6B;">babel-core</span><span style="color:#89DDFF;">&quot;</span><span style="color:#89DDFF;">:</span><span style="color:#A6ACCD;"> </span><span style="color:#89DDFF;">&quot;</span><span style="color:#C3E88D;">^6.26.0</span><span style="color:#89DDFF;">&quot;</span><span style="color:#89DDFF;">,</span></span>\n<span class="line"><span style="color:#A6ACCD;">    </span><span style="color:#89DDFF;">&quot;</span><span style="color:#FFCB6B;">babel-loader</span><span style="color:#89DDFF;">&quot;</span><span style="color:#89DDFF;">:</span><span style="color:#A6ACCD;"> </span><span style="color:#89DDFF;">&quot;</span><span style="color:#C3E88D;">^7.1.2</span><span style="color:#89DDFF;">&quot;</span><span style="color:#89DDFF;">,</span></span>\n<span class="line"><span style="color:#A6ACCD;">    </span><span style="color:#89DDFF;">&quot;</span><span style="color:#FFCB6B;">babel-preset-env</span><span style="color:#89DDFF;">&quot;</span><span style="color:#89DDFF;">:</span><span style="color:#A6ACCD;"> </span><span style="color:#89DDFF;">&quot;</span><span style="color:#C3E88D;">^1.6.0</span><span style="color:#89DDFF;">&quot;</span><span style="color:#89DDFF;">,</span></span>\n<span class="line"><span style="color:#A6ACCD;">    </span><span style="color:#89DDFF;">&quot;</span><span style="color:#FFCB6B;">babel-preset-stage-3</span><span style="color:#89DDFF;">&quot;</span><span style="color:#89DDFF;">:</span><span style="color:#A6ACCD;"> </span><span style="color:#89DDFF;">&quot;</span><span style="color:#C3E88D;">^6.24.1</span><span style="color:#89DDFF;">&quot;</span><span style="color:#89DDFF;">,</span></span>\n<span class="line"><span style="color:#A6ACCD;">    </span><span style="color:#89DDFF;">&quot;</span><span style="color:#FFCB6B;">cross-env</span><span style="color:#89DDFF;">&quot;</span><span style="color:#89DDFF;">:</span><span style="color:#A6ACCD;"> </span><span style="color:#89DDFF;">&quot;</span><span style="color:#C3E88D;">^5.0.5</span><span style="color:#89DDFF;">&quot;</span><span style="color:#89DDFF;">,</span></span>\n<span class="line"><span style="color:#A6ACCD;">    </span><span style="color:#89DDFF;">&quot;</span><span style="color:#FFCB6B;">css-loader</span><span style="color:#89DDFF;">&quot;</span><span style="color:#89DDFF;">:</span><span style="color:#A6ACCD;"> </span><span style="color:#89DDFF;">&quot;</span><span style="color:#C3E88D;">^0.28.7</span><span style="color:#89DDFF;">&quot;</span><span style="color:#89DDFF;">,</span></span>\n<span class="line"><span style="color:#A6ACCD;">    </span><span style="color:#89DDFF;">&quot;</span><span style="color:#FFCB6B;">file-loader</span><span style="color:#89DDFF;">&quot;</span><span style="color:#89DDFF;">:</span><span style="color:#A6ACCD;"> </span><span style="color:#89DDFF;">&quot;</span><span style="color:#C3E88D;">^1.1.4</span><span style="color:#89DDFF;">&quot;</span><span style="color:#89DDFF;">,</span></span>\n<span class="line"><span style="color:#A6ACCD;">    </span><span style="color:#89DDFF;">&quot;</span><span style="color:#FFCB6B;">vue-loader</span><span style="color:#89DDFF;">&quot;</span><span style="color:#89DDFF;">:</span><span style="color:#A6ACCD;"> </span><span style="color:#89DDFF;">&quot;</span><span style="color:#C3E88D;">^13.0.5</span><span style="color:#89DDFF;">&quot;</span><span style="color:#89DDFF;">,</span></span>\n<span class="line"><span style="color:#A6ACCD;">    </span><span style="color:#89DDFF;">&quot;</span><span style="color:#FFCB6B;">vue-template-compiler</span><span style="color:#89DDFF;">&quot;</span><span style="color:#89DDFF;">:</span><span style="color:#A6ACCD;"> </span><span style="color:#89DDFF;">&quot;</span><span style="color:#C3E88D;">^2.4.4</span><span style="color:#89DDFF;">&quot;</span><span style="color:#89DDFF;">,</span></span>\n<span class="line"><span style="color:#A6ACCD;">    </span><span style="color:#89DDFF;">&quot;</span><span style="color:#FFCB6B;">webpack</span><span style="color:#89DDFF;">&quot;</span><span style="color:#89DDFF;">:</span><span style="color:#A6ACCD;"> </span><span style="color:#89DDFF;">&quot;</span><span style="color:#C3E88D;">^3.6.0</span><span style="color:#89DDFF;">&quot;</span><span style="color:#89DDFF;">,</span></span>\n<span class="line"><span style="color:#A6ACCD;">    </span><span style="color:#89DDFF;">&quot;</span><span style="color:#FFCB6B;">webpack-cli</span><span style="color:#89DDFF;">&quot;</span><span style="color:#89DDFF;">:</span><span style="color:#A6ACCD;"> </span><span style="color:#89DDFF;">&quot;</span><span style="color:#C3E88D;">^4.9.1</span><span style="color:#89DDFF;">&quot;</span><span style="color:#89DDFF;">,</span></span>\n<span class="line"><span style="color:#A6ACCD;">    </span><span style="color:#89DDFF;">&quot;</span><span style="color:#FFCB6B;">webpack-dev-server</span><span style="color:#89DDFF;">&quot;</span><span style="color:#89DDFF;">:</span><span style="color:#A6ACCD;"> </span><span style="color:#89DDFF;">&quot;</span><span style="color:#C3E88D;">&gt;=3.1.11</span><span style="color:#89DDFF;">&quot;</span></span>\n<span class="line"><span style="color:#A6ACCD;">  </span><span style="color:#89DDFF;">}</span></span>\n<span class="line"><span style="color:#89DDFF;">}</span></span>\n<span class="line"></span></code></pre></div><h1 id="dependencies\u4E2Dfile" tabindex="-1">dependencies\u4E2Dfile: <a class="header-anchor" href="#dependencies\u4E2Dfile" aria-hidden="true">#</a></h1><p>\u5C31\u662F\u6B63\u5E38\u7684\u672C\u5730\u6587\u4EF6\uFF0C\u8FD9\u91CC <code>../node_modules/react</code> \u7684\u5C31\u8868\u793A\u5F53\u524D\u9879\u76EE\u6240\u5728\u76EE\u5F55\u7684\u4E0A\u4E00\u7EA7\u76EE\u5F55\u7684 <code>node_modules/react</code>\u3002</p><h2 id="\u53D1\u5E03\u4E0E\u4E0B\u67B6-npm-\u5305" tabindex="-1">\u53D1\u5E03\u4E0E\u4E0B\u67B6 npm \u5305 <a class="header-anchor" href="#\u53D1\u5E03\u4E0E\u4E0B\u67B6-npm-\u5305" aria-hidden="true">#</a></h2><ol><li>npm login</li><li>\u8F93\u5165 username\uFF08npm \u8D26\u6237\uFF0C\u6CA1\u6709\u53EF\u4EE5\u53BB npm \u5B98\u7F51\u6CE8\u518C\uFF0Cbing \u641C\u7D22 npm \u5373\u53EF\uFF09</li><li>\u8F93\u5165 password</li><li>npm publish</li></ol><p>\u6CE8\u610F\uFF01\u4E0D\u80FD\u4F7F\u7528\u6DD8\u5B9D\u955C\u50CF\uFF0C\u9700\u8981\u5207\u6362\u56DE\u9ED8\u8BA4 npm \u8DEF\u5F84</p><div class="language-sh"><pre><code><span class="line"><span style="color:#A6ACCD;">npm config </span><span style="color:#82AAFF;">set</span><span style="color:#A6ACCD;"> registry https://registry.npmjs.org/</span></span>\n<span class="line"></span></code></pre></div><p>\u66F4\u65B0\u7248\u672C\u53F7,\u5E38\u7528\u547D\u4EE4</p><div class="language-sh"><pre><code><span class="line"><span style="color:#A6ACCD;">npm version patch</span></span>\n<span class="line"></span></code></pre></div><p>\u4E0B\u67B6</p><div class="language-sh"><pre><code><span class="line"><span style="color:#676E95;font-style:italic;"># \u6D4B\u8BD5\u5305\u53EF\u4EE5\u968F\u610F\u4E0B\u67B6\uFF0C\u5982\u679C\u4F60\u7684\u5305\u6709\u4F7F\u7528\u8005\u540E\u4E0D\u80FD\u8FD9\u6837\u5E72</span></span>\n<span class="line"><span style="color:#A6ACCD;">npm unpublish -f</span></span>\n<span class="line"></span></code></pre></div><h2 id="\u672C\u5730\u8C03\u8BD5\u7EC4\u4EF6\u5E93" tabindex="-1">\u672C\u5730\u8C03\u8BD5\u7EC4\u4EF6\u5E93 <a class="header-anchor" href="#\u672C\u5730\u8C03\u8BD5\u7EC4\u4EF6\u5E93" aria-hidden="true">#</a></h2><blockquote><p>\u7EC4\u4EF6\u5E93\u672C\u8D28\u4E0A\u4E5F\u662F\u4E00\u4E2Anpm\u5305</p></blockquote><p>yalc\u7528\u4E8E\u672C\u5730\u8C03\u8BD5\u7EC4\u4EF6\u5E93</p><div class="language-sh"><pre><code><span class="line"><span style="color:#A6ACCD;">npm -g i yalc</span></span>\n<span class="line"></span></code></pre></div><p>\u5728\u7EC4\u4EF6\u5E93\u9879\u76EE\u4E2D\u8FD0\u884C\u4EE5\u4E0B\u547D\u4EE4,\u5C06\u4F1A\u628A\u8BE5\u9879\u76EE\u4F5C\u4E3A npm \u5305\u53D1\u5E03\u81F3\u672C\u5730 yalc \u4E2D\uFF0C\u5305\u540D\u4E3A package.json \u4E2D name</p><div class="language-sh"><pre><code><span class="line"><span style="color:#A6ACCD;">yalc publish</span></span>\n<span class="line"></span></code></pre></div><p>\u63A5\u7740\u6DFB\u52A0\u7EC4\u4EF6\u5E93\u7684\u9879\u76EE\u81F3\u5F00\u53D1\u9879\u76EE\uFF0C\u4E0B\u8F7D\u4F9D\u8D56\uFF0C\u8FD9\u6837\u5C31\u53EF\u4EE5\u5FEB\u901F\u6D4B\u8BD5\u7EC4\u4EF6\u5E93\u4E86</p><div class="language-sh"><pre><code><span class="line"><span style="color:#A6ACCD;">yalc add \u7EC4\u4EF6\u5E93\u540D</span></span>\n<span class="line"><span style="color:#A6ACCD;">yarn</span></span>\n<span class="line"></span></code></pre></div><h2 id="\u4F9D\u8D56\u5305\u7248\u672C\u53F7-\uFF0C-\u548C" tabindex="-1">\u4F9D\u8D56\u5305\u7248\u672C\u53F7~\uFF0C^\u548C* <a class="header-anchor" href="#\u4F9D\u8D56\u5305\u7248\u672C\u53F7-\uFF0C-\u548C" aria-hidden="true">#</a></h2><ul><li><code>~</code>\u4F1A\u5339\u914D\u6700\u8FD1\u7684\u5C0F\u7248\u672C\u4F9D\u8D56\u5305\uFF0C\u6BD4\u5982~1.2.3\u4F1A\u5339\u914D\u6240\u67091.2.x\u7248\u672C\uFF0C\u4F46\u662F\u4E0D\u5305\u62EC1.3.0</li><li><code>^</code>\u4F1A\u5339\u914D\u6700\u65B0\u7684\u5927\u7248\u672C\u4F9D\u8D56\u5305\uFF0C\u6BD4\u5982^1.2.3\u4F1A\u5339\u914D\u6240\u67091.x.x\u7684\u5305\uFF0C\u5305\u62EC1.3.0\uFF0C\u4F46\u662F\u4E0D\u5305\u62EC2.0.0</li><li>\u53EF\u4EE5\u6307\u5B9A\u7279\u5B9A\u7684\u7248\u672C\u53F7\uFF0C\u76F4\u63A5\u51991.2.3\uFF0C\u524D\u9762\u4EC0\u4E48\u524D\u7F00\u90FD\u6CA1\u6709\uFF0C\u8FD9\u6837\u56FA\u7136\u6CA1\u95EE\u9898\uFF0C\u4F46\u662F\u5982\u679C\u4F9D\u8D56\u5305\u53D1\u5E03\u65B0\u7248\u672C\u4FEE\u590D\u4E86\u4E00\u4E9B\u5C0Fbug\uFF0C\u90A3\u4E48\u9700\u8981\u624B\u52A8\u4FEE\u6539<code>package.json</code>\u6587\u4EF6\uFF1B<code>~</code>\u548C<code>^</code>\u5219\u53EF\u4EE5\u89E3\u51B3\u8FD9\u4E2A\u95EE\u9898\u3002</li><li>\u6CE8\u610F<code>^</code>\u7248\u672C\u66F4\u65B0\u53EF\u80FD\u6BD4\u8F83\u5927\uFF0C\u4F1A\u9020\u6210\u9879\u76EE\u4EE3\u7801\u9519\u8BEF\uFF0C\u6240\u4EE5<strong>\u5EFA\u8BAE\u4F7F\u7528<code>~</code>\u6765\u6807\u8BB0\u7248\u672C\u53F7</strong>\uFF0C\u8FD9\u6837\u53EF\u4EE5\u4FDD\u8BC1\u9879\u76EE\u4E0D\u4F1A\u51FA\u73B0\u5927\u7684\u95EE\u9898\uFF0C\u4E5F\u80FD\u4FDD\u8BC1\u5305\u4E2D\u7684\u5C0Fbug\u53EF\u4EE5\u5F97\u5230\u4FEE\u590D</li><li>\u7248\u672C\u53F7\u5199<code>*</code>\uFF0C\u8FD9\u610F\u5473\u7740<strong>\u5B89\u88C5\u6700\u65B0\u7248\u672C\u7684\u4F9D\u8D56\u5305</strong>\uFF0C\u4F46\u7F3A\u70B9\u540C\u4E0A\uFF0C\u53EF\u80FD\u4F1A\u9020\u6210\u7248\u672C\u4E0D\u517C\u5BB9\uFF0C<strong>\u614E\u7528</strong>\uFF01</li></ul><h2 id="vue-add-\u548C-npm-i-\u533A\u522B" tabindex="-1">vue add \u548C npm i \u533A\u522B <a class="header-anchor" href="#vue-add-\u548C-npm-i-\u533A\u522B" aria-hidden="true">#</a></h2><p>\u76F8\u540C\uFF1A\u90FD\u662F\u4E0B\u8F7D\u5728 npm \u5E02\u573A\u91CC\u7684 npm \u5305</p><p>\u533A\u522B\uFF1Avue add \u662F\u4F7F\u7528@vue/cli \u8FD9\u4E2A npm \u5305\u91CC\u9762\u7684\u547D\u4EE4\uFF0C\u53BB\u6DFB\u52A0 vue \u56E2\u961F\u5F00\u53D1\u7684 vue \u76F8\u5173\u7684 npm \u5305\uFF0C\u5F53\u7136\uFF0C\u8FD9\u4E9B npm \u5305\u4E5F\u53EF\u4EE5\u81EA\u884C npm i \u7684\u65B9\u5F0F\u4E0B\u8F7D</p><h2 id="\u672C\u5730\u8FD0\u884C\u6253\u5305\u540E\u524D\u7AEF\u9879\u76EE" tabindex="-1">\u672C\u5730\u8FD0\u884C\u6253\u5305\u540E\u524D\u7AEF\u9879\u76EE <a class="header-anchor" href="#\u672C\u5730\u8FD0\u884C\u6253\u5305\u540E\u524D\u7AEF\u9879\u76EE" aria-hidden="true">#</a></h2><p>\u672C\u8D28\u4E0A\u5C31\u662F\u4F7F\u7528 node \u542F\u52A8\u670D\u52A1\u5668\uFF0C\u6765\u8FD0\u884C\u524D\u7AEF\u9879\u76EE</p><div class="language-sh"><pre><code><span class="line"><span style="color:#A6ACCD;">npm i -g serve</span></span>\n<span class="line"><span style="color:#A6ACCD;">serve -s \u6253\u5305\u6587\u4EF6\u5939\u540D</span></span>\n<span class="line"></span></code></pre></div>', 90);
  const _hoisted_91 = [
    _hoisted_1
  ];
  function _sfc_render(_ctx, _cache, $props, $setup, $data, $options) {
    return openBlock(), createElementBlock("div", null, _hoisted_91);
  }
  var _1_npm = /* @__PURE__ */ _export_sfc(_sfc_main, [["render", _sfc_render]]);
  export { __pageData, _1_npm as default };
  