{"id":4892,"date":"2016-03-17T10:40:54","date_gmt":"2016-03-17T02:40:54","guid":{"rendered":"https:\/\/sdeno.com\/?p=4892"},"modified":"2019-06-20T12:24:13","modified_gmt":"2019-06-20T04:24:13","slug":"npm%e7%ac%94%e8%ae%b0","status":"publish","type":"post","link":"https:\/\/sdeno.com\/?p=4892","title":{"rendered":"npm\u7b14\u8bb0"},"content":{"rendered":"<p>\u5173\u4e8e\u73af\u5883\u53d8\u91cf\u7684\u8bbe\u7f6e\u8bf7\u770b\uff1a<a href=\"https:\/\/sdeno.com\/?p=4740\" target=\"_blank\" rel=\"noopener\">https:\/\/sdeno.com\/?p=4740<\/a><\/p>\n<p>nodejs\u7684\u51fa\u73b0\uff0c\u53ef\u4ee5\u7b97\u662f\u524d\u7aef\u91cc\u7a0b\u7891\u5f0f\u7684\u4e00\u4e2a\u4e8b\u4ef6\uff0c\u5b83\u8ba9\u524d\u7aef\u653b\u57ce\u72ee\u4eec\u6446\u8131\u4e86\u6d4f\u89c8\u5668\u7684\u675f\u7f1a\uff0c\u8e0f\u4e0a\u4e86\u4e00\u4e2a\u66f4\u52a0\u5bbd\u5e7f\u7684\u821e\u53f0\u3002\u524d\u7aef\u7684\u53ef\u80fd\u6027\uff0c\u4ece\u6b64\u66f4\u52a0\u5177\u6709\u60f3\u8c61\u7a7a\u95f4\u3002<\/p>\n<p>\u968f\u7740\u4e00\u7cfb\u5217\u57fa\u4e8enodes\u7684\u5e94\u7528\/\u5de5\u5177\u7684\u51fa\u73b0\uff0c\u5de5\u4f5c\u4e2d\u4e0enodejs\u6253\u4ea4\u9053\u7684\u673a\u4f1a\u8d8a\u6765\u8d8a\u591a\u3002\u65e0\u8bba\u5728node\u5e94\u7528\u7684\u5f00\u53d1\uff0c\u8fd8\u662f\u4f7f\u7528\u4e2d\uff0c\u5305\u7ba1\u7406\u90fd\u626e\u6f14\u7740\u4e00\u4e2a\u5f88\u91cd\u8981\u7684\u4f5c\u7528\u3002NPM\uff08node package manager\uff09\uff0c\u4f5c\u4e3anode\u7684\u5305\u7ba1\u7406\u5de5\u5177\uff0c\u6781\u5927\u5730\u4fbf\u5229\u4e86\u6211\u4eec\u7684\u5f00\u53d1\u5de5\u4f5c\uff0c\u5f88\u6709\u5fc5\u8981\u4e86\u89e3\u4e00\u4e0b\u3002<\/p>\n<div>\n<h2 style=\"font-weight: bold; color: inherit;\">NPM\u662f\u4ec0\u4e48<\/h2>\n<\/div>\n<p>NPM\uff08node package manager\uff09\uff0c\u901a\u5e38\u79f0\u4e3anode\u5305\u7ba1\u7406\u5668\u3002\u987e\u540d\u601d\u4e49\uff0c\u5b83\u7684\u4e3b\u8981\u529f\u80fd\u5c31\u662f\u7ba1\u7406node\u5305\uff0c\u5305\u62ec\uff1a\u5b89\u88c5\u3001\u5378\u8f7d\u3001\u66f4\u65b0\u3001\u67e5\u770b\u3001\u641c\u7d22\u3001\u53d1\u5e03\u7b49\u3002<\/p>\n<p>npm\u7684\u80cc\u540e\uff0c\u662f\u57fa\u4e8ecouchdb\u7684\u4e00\u4e2a\u6570\u636e\u5e93\uff0c\u8be6\u7ec6\u8bb0\u5f55\u4e86\u6bcf\u4e2a\u5305\u7684\u4fe1\u606f\uff0c\u5305\u62ec\u4f5c\u8005\u3001\u7248\u672c\u3001\u4f9d\u8d56\u3001\u6388\u6743\u4fe1\u606f\u7b49\u3002\u5b83\u7684\u4e00\u4e2a\u5f88\u91cd\u8981\u7684\u4f5c\u7528\u5c31\u662f\uff1a\u5c06\u5f00\u53d1\u8005\u4ece\u7e41\u7410\u7684\u5305\u7ba1\u7406\u5de5\u4f5c\uff08\u7248\u672c\u3001\u4f9d\u8d56\u7b49\uff09\u4e2d\u89e3\u653e\u51fa\u6765\uff0c\u66f4\u52a0\u4e13\u6ce8\u4e8e\u529f\u80fd\u7684\u5f00\u53d1\u3002<\/p>\n<p>npm\u5b98\u7f51\uff1a\u00a0<a style=\"font-weight: bold; font-style: italic; color: #949494;\" href=\"https:\/\/npmjs.org\/\">https:\/\/npmjs.org\/<\/a><\/p>\n<p>npm\u5b98\u65b9\u6587\u6863\uff1a\u00a0<a style=\"font-weight: bold; font-style: italic; color: #949494;\" href=\"https:\/\/npmjs.org\/doc\/README.html\">https:\/\/npmjs.org\/doc\/README.html<\/a><\/p>\n<div>\n<h2 style=\"font-weight: bold; color: inherit;\">\u6211\u4eec\u9700\u8981\u4e86\u89e3\u4ec0\u4e48<\/h2>\n<\/div>\n<ol>\n<li>npm\u7684\u5b89\u88c5\u3001\u5378\u8f7d\u3001\u5347\u7ea7\u3001\u914d\u7f6e<\/li>\n<li>npm\u7684\u4f7f\u7528\uff1apackage\u7684\u5b89\u88c5\u3001\u5378\u8f7d\u3001\u5347\u7ea7\u3001\u67e5\u770b\u3001\u641c\u7d22\u3001\u53d1\u5e03<\/li>\n<li>npm\u5305\u7684\u5b89\u88c5\u6a21\u5f0f\uff1a\u672c\u5730 vs \u5168\u5c40<\/li>\n<li>package.json\uff1a\u5305\u63cf\u8ff0\u4fe1\u606f<\/li>\n<li>package\u7248\u672c\uff1a\u5e38\u89c1\u7248\u672c\u58f0\u660e\u5f62\u5f0f<\/li>\n<\/ol>\n<div>\n<h2 style=\"font-weight: bold; color: inherit;\">npm\u5305\u5b89\u88c5\u6a21\u5f0f<\/h2>\n<\/div>\n<p>\u5728\u5177\u4f53\u4ecb\u7ecdnpm\u5305\u7684\u7ba1\u7406\u4e4b\u524d\uff0c\u6211\u4eec\u9996\u5148\u5f97\u6765\u4e86\u89e3\u4e00\u4e0bnpm\u5305\u7684\u4e24\u79cd\u5b89\u88c5\u6a21\u5f0f\u3002<\/p>\n<h3 style=\"font-weight: bold;\">\u672c\u5730\u5b89\u88c5 vs \u5168\u5c40\u5b89\u88c5\uff08\u91cd\u8981\uff09<\/h3>\n<p>node\u5305\u7684\u5b89\u88c5\u5206\u4e24\u79cd\uff1a\u672c\u5730\u5b89\u88c5\u3001\u5168\u5c40\u5b89\u88c5\u3002\u4e24\u8005\u7684\u533a\u522b\u5982\u4e0b\uff0c\u540e\u9762\u4f1a\u901a\u8fc7\u7b80\u5355\u4f8b\u5b50\u8bf4\u660e<\/p>\n<ul>\n<li>\u672c\u5730\u5b89\u88c5\uff1apackage\u4f1a\u88ab\u4e0b\u8f7d\u5230\u5f53\u524d\u6240\u5728\u76ee\u5f55\uff0c\u4e5f\u53ea\u80fd\u5728\u5f53\u524d\u76ee\u5f55\u4e0b\u4f7f\u7528\u3002<\/li>\n<li>\u5168\u5c40\u5b89\u88c5\uff1apackage\u4f1a\u88ab\u4e0b\u8f7d\u5230\u5230\u7279\u5b9a\u7684\u7cfb\u7edf\u76ee\u5f55\u4e0b\uff0c\u5b89\u88c5\u7684package\u80fd\u591f\u5728\u6240\u6709\u76ee\u5f55\u4e0b\u4f7f\u7528\u3002<\/li>\n<\/ul>\n<h3 style=\"font-weight: bold;\">npm install pkg &#8211; \u672c\u5730\u5b89\u88c5<\/h3>\n<p>\u8fd0\u884c\u5982\u4e0b\u547d\u4ee4\uff0c\u5c31\u4f1a\u5728\u5f53\u524d\u76ee\u5f55\u4e0b\u5b89\u88c5\u00a0<code class=\"prettyprint\" style=\"color: #333333 !important;\">grunt-cli<\/code>\u00a0\uff08grunt\u547d\u4ee4\u884c\u5de5\u5177\uff09<\/p>\n<div>\n<pre class=\"prettyprint undefined\"><code>npm install grunt-cli<\/code><\/pre>\n<\/div>\n<p>\u5b89\u88c5\u7ed3\u675f\u540e\uff0c\u5f53\u524d\u76ee\u5f55\u4e0b\u56de\u591a\u51fa\u4e00\u4e2a\u00a0<code class=\"prettyprint\" style=\"color: #333333 !important;\">node_modules<\/code>\u00a0\u76ee\u5f55\uff0cgrunt-cli\u5c31\u5b89\u88c5\u5728\u91cc\u9762\u3002\u540c\u65f6\u6ce8\u610f\u63a7\u5236\u53f0\u8f93\u51fa\u7684\u4fe1\u606f\uff1a<\/p>\n<div>\n<pre class=\"prettyprint ruby\"><a style=\"font-weight: bold; font-style: italic; color: #949494;\" href=\"mailto:grunt-cli@0.1.9\">grunt-cli<span class=\"variable\" style=\"color: #008080;\">@0<\/span>.<span class=\"number\" style=\"color: #009999;\">1.9<\/span><\/a> node_modules\/grunt-cli<\/pre>\n<pre class=\"prettyprint ruby\">\u251c\u2500\u2500 <a style=\"font-weight: bold; font-style: italic; color: #949494;\" href=\"mailto:resolve@0.3.1\">resolve<span class=\"variable\" style=\"color: #008080;\">@0<\/span>.<span class=\"number\" style=\"color: #009999;\">3.1<\/span><\/a><\/pre>\n<pre class=\"prettyprint ruby\">\u251c\u2500\u2500 <a style=\"font-weight: bold; font-style: italic; color: #949494;\" href=\"mailto:nopt@1.0.10\">nopt<span class=\"variable\" style=\"color: #008080;\">@1<\/span>.<span class=\"number\" style=\"color: #009999;\">0<\/span>.<span class=\"number\" style=\"color: #009999;\">10<\/span><\/a> (<a style=\"font-weight: bold; font-style: italic; color: #949494;\" href=\"mailto:abbrev@1.0.4\">abbrev<span class=\"variable\" style=\"color: #008080;\">@1<\/span>.<span class=\"number\" style=\"color: #009999;\">0<\/span>.<span class=\"number\" style=\"color: #009999;\">4<\/span><\/a>)<\/pre>\n<pre class=\"prettyprint perl\">\u2514\u2500\u2500 <a style=\"font-weight: bold; font-style: italic; color: #949494;\" href=\"mailto:findup-sync@0.1.2\">findup-sync<span class=\"variable\" style=\"color: #008080;\">@0<\/span>.<span class=\"number\" style=\"color: #009999;\">1.2<\/span><\/a> (<a style=\"font-weight: bold; font-style: italic; color: #949494;\" href=\"mailto:lodash@1.0.1\">lodash<span class=\"variable\" style=\"color: #008080;\">@1<\/span>.<span class=\"number\" style=\"color: #009999;\">0<\/span>.<span class=\"number\" style=\"color: #009999;\">1<\/span><\/a>, <a style=\"font-weight: bold; font-style: italic; color: #949494;\" href=\"mailto:glob@3.1.21\"><span class=\"keyword\" style=\"font-weight: bold;\">glob<\/span><span class=\"variable\" style=\"color: #008080;\">@3<\/span>.<span class=\"number\" style=\"color: #009999;\">1.21<\/span><\/a>)<\/pre>\n<\/div>\n<p>\u7b80\u5355\u8bf4\u660e\u4e00\u4e0b\uff1a<\/p>\n<ul>\n<li>grunt-cli@0.1.9\uff1a\u5f53\u524d\u5b89\u88c5\u7684package\u4e3agrunt-cli\uff0c\u7248\u672c\u4e3a0.19<\/li>\n<li>node_modules\/grunt-cli\uff1a\u5b89\u88c5\u76ee\u5f55<\/li>\n<li>resolve@0.3.1\uff1a\u4f9d\u8d56\u7684\u5305\u6709resolve\u3001nopt\u3001findup-sync\uff0c\u5b83\u4eec\u5404\u81ea\u7684\u7248\u672c\u3001\u4f9d\u8d56\u5728\u540e\u9762\u7684\u62ec\u53f7\u91cc\u5217\u51fa\u6765<\/li>\n<\/ul>\n<h3 style=\"font-weight: bold;\">npm install -g pkg- \u5168\u5c40\u5b89\u88c5<\/h3>\n<p>\u4e0a\u9762\u5df2\u7ecf\u5b89\u88c5\u4e86grunt-cli\uff0c\u7136\u540e\u4f60\u8dd1\u5230\u5176\u4ed6\u76ee\u5f55\u4e0b\u9762\u8fd0\u884c\u5982\u4e0b\u547d\u4ee4<\/p>\n<div>\n<pre class=\"prettyprint http\"><code><span class=\"attribute\" style=\"color: #008080;\">grunt<\/span><\/code><\/pre>\n<\/div>\n<p>\u679c\u65ad\u63d0\u793a\u4f60grunt\u547d\u4ee4\u4e0d\u5b58\u5728\uff0c\u4e3a\u4ec0\u4e48\u5462\uff1f\u56e0\u4e3a\u4e0a\u9762\u53ea\u662f\u8fdb\u884c\u4e86\u00a0<strong style=\"font-weight: bold;\">\u672c\u5730\u5b89\u88c5<\/strong>\u00a0\uff0cgrunt\u547d\u4ee4\u53ea\u80fd\u5728\u5bf9\u5e94\u5b89\u88c5\u76ee\u5f55\u4e0b\u4f7f\u7528\u3002<\/p>\n<div>\n<pre class=\"prettyprint ruby\"><code>-<span class=\"symbol\" style=\"color: #990073;\">bash:<\/span> <span class=\"symbol\" style=\"color: #990073;\">grunt:<\/span> command <span class=\"keyword\" style=\"font-weight: bold;\">not<\/span> found<\/code><\/pre>\n<\/div>\n<p>\u5982\u679c\u4e3a\u4e86\u4f7f\u7528grunt\u547d\u4ee4\uff0c\u6bcf\u5230\u4e00\u4e2a\u76ee\u5f55\u4e0b\u90fd\u5f97\u91cd\u65b0\u5b89\u88c5\u4e00\u6b21\uff0c\u90a3\u4e0d\u6293\u72c2\u624d\u602a\u3002\u80bf\u4e48\u529e\u5462\uff1f<\/p>\n<p>\u5f88\u7b80\u5355\uff0c\u91c7\u7528\u5168\u5c40\u5b89\u88c5\u5c31\u884c\u4e86\uff0c\u5f88\u7b80\u5355\uff0c\u52a0\u4e0a\u53c2\u6570\u00a0<code class=\"prettyprint\" style=\"color: #333333 !important;\">-g<\/code>\u00a0\u5c31\u53ef\u4ee5\u4e86<\/p>\n<div>\n<pre class=\"prettyprint undefined\"><code>npm install -g grunt-cli<\/code><\/pre>\n<\/div>\n<p>\u4e8e\u662f\uff0c\u5728\u6240\u6709\u76ee\u5f55\u4e0b\u90fd\u53ef\u4ee5\u65e0\u538b\u529b\u4f7f\u7528\u00a0<code class=\"prettyprint\" style=\"color: #333333 !important;\">grunt<\/code>\u00a0\u547d\u4ee4\u4e86\u3002\u8fd9\u4e2a\u65f6\u5019\uff0c\u4f60\u4f1a\u6ce8\u610f\u5230\u63a7\u5236\u53f0\u8f93\u5165\u7684\u4fe1\u606f\u6709\u70b9\u4e0d\u540c\u3002\u4e3b\u8981\u7684\u533a\u522b\u5728\u4e8e\u5b89\u88c5\u76ee\u5f55\uff0c\u73b0\u5728\u53d8\u6210\u4e86<code class=\"prettyprint\" style=\"color: #333333 !important;\">\/usr\/local\/lib\/node_modules\/grunt-cli<\/code>\u00a0\uff0c<code class=\"prettyprint\" style=\"color: #333333 !important;\">\/usr\/local\/lib\/node_modules\/<\/code>\u00a0\u4e5f\u5c31\u662f\u4e4b\u524d\u6240\u8bf4\u7684\u5168\u5c40\u5b89\u88c5\u76ee\u5f55\u5566\u3002<\/p>\n<div>\n<pre class=\"prettyprint perl\"><a style=\"font-weight: bold; font-style: italic; color: #949494;\" href=\"mailto:grunt-cli@0.1.9\">grunt-cli<span class=\"variable\" style=\"color: #008080;\">@0<\/span>.<span class=\"number\" style=\"color: #009999;\">1.9<\/span><\/a> \/usr\/<span class=\"keyword\" style=\"font-weight: bold;\">local<\/span>\/lib\/node_modules\/grunt-cli<\/pre>\n<pre class=\"prettyprint ruby\">\u251c\u2500\u2500 <a style=\"font-weight: bold; font-style: italic; color: #949494;\" href=\"mailto:resolve@0.3.1\">resolve<span class=\"variable\" style=\"color: #008080;\">@0<\/span>.<span class=\"number\" style=\"color: #009999;\">3.1<\/span><\/a><\/pre>\n<pre class=\"prettyprint ruby\">\u251c\u2500\u2500 <a style=\"font-weight: bold; font-style: italic; color: #949494;\" href=\"mailto:nopt@1.0.10\">nopt<span class=\"variable\" style=\"color: #008080;\">@1<\/span>.<span class=\"number\" style=\"color: #009999;\">0<\/span>.<span class=\"number\" style=\"color: #009999;\">10<\/span><\/a> (<a style=\"font-weight: bold; font-style: italic; color: #949494;\" href=\"mailto:abbrev@1.0.4\">abbrev<span class=\"variable\" style=\"color: #008080;\">@1<\/span>.<span class=\"number\" style=\"color: #009999;\">0<\/span>.<span class=\"number\" style=\"color: #009999;\">4<\/span><\/a>)<\/pre>\n<pre class=\"prettyprint perl\">\u2514\u2500\u2500 <a style=\"font-weight: bold; font-style: italic; color: #949494;\" href=\"mailto:findup-sync@0.1.2\">findup-sync<span class=\"variable\" style=\"color: #008080;\">@0<\/span>.<span class=\"number\" style=\"color: #009999;\">1.2<\/span><\/a> (<a style=\"font-weight: bold; font-style: italic; color: #949494;\" href=\"mailto:lodash@1.0.1\">lodash<span class=\"variable\" style=\"color: #008080;\">@1<\/span>.<span class=\"number\" style=\"color: #009999;\">0<\/span>.<span class=\"number\" style=\"color: #009999;\">1<\/span><\/a>, <a style=\"font-weight: bold; font-style: italic; color: #949494;\" href=\"mailto:glob@3.1.21\"><span class=\"keyword\" style=\"font-weight: bold;\">glob<\/span><span class=\"variable\" style=\"color: #008080;\">@3<\/span>.<span class=\"number\" style=\"color: #009999;\">1.21<\/span><\/a>)<\/pre>\n<\/div>\n<div>\n<h2 style=\"font-weight: bold; color: inherit;\">npm\u5305\u7ba1\u7406<\/h2>\n<\/div>\n<p>npm\u7684\u5305\u7ba1\u7406\u547d\u4ee4\u662f\u4f7f\u7528\u9891\u7387\u6700\u9ad8\u7684\uff0c\u6240\u4ee5\u4e5f\u662f\u6211\u4eec\u9700\u8981\u7262\u7262\u8bb0\u4f4f\u5e76\u719f\u7ec3\u4f7f\u7528\u7684\u3002\u5176\u5b9e\u65e0\u975e\u4e5f\u5c31\u662f\u51e0\u4e2a\u52a8\u4f5c\uff1a\u5b89\u88c5\u3001\u5378\u8f7d\u3001\u66f4\u65b0\u3001\u67e5\u770b\u3001\u641c\u7d22\u3001\u53d1\u5e03\u7b49\u3002<\/p>\n<h3 style=\"font-weight: bold;\">\u5b89\u88c5\u6700\u65b0\u7248\u672c\u7684grunt-cli<\/h3>\n<div>\n<pre class=\"prettyprint undefined\"><code>npm install grunt-cli<\/code><\/pre>\n<\/div>\n<h3 style=\"font-weight: bold;\">\u5b89\u88c50.1.9\u7248\u672c\u7684grunt-cli<\/h3>\n<div>\n<pre class=\"prettyprint cs\"><code>npm install <a style=\"font-weight: bold; font-style: italic; color: #949494;\" href=\"mailto:grunt-cli@%220.1.9\">grunt-cli<span class=\"string\" style=\"color: #dd1144;\">@\"0.1.9<\/span><\/a><span class=\"string\" style=\"color: #dd1144;\">\"<\/span><\/code><\/pre>\n<\/div>\n<h3 style=\"font-weight: bold;\">\u901a\u8fc7package.json\u8fdb\u884c\u5b89\u88c5<\/h3>\n<p>\u5982\u679c\u6211\u4eec\u7684\u9879\u76ee\u4f9d\u8d56\u4e86\u5f88\u591apackage\uff0c\u4e00\u4e2a\u4e00\u4e2a\u5730\u5b89\u88c5\u90a3\u5c06\u662f\u4e2a\u4f53\u529b\u6d3b\u3002\u6211\u4eec\u53ef\u4ee5\u5c06\u9879\u76ee\u4f9d\u8d56\u7684\u5305\u90fd\u5728package.json\u8fd9\u4e2a\u6587\u4ef6\u91cc\u58f0\u660e\uff0c\u7136\u540e\u4e00\u884c\u547d\u4ee4\u641e\u5b9a<\/p>\n<div>\n<pre class=\"prettyprint undefined\"><code>npm install<\/code><\/pre>\n<\/div>\n<h3 style=\"font-weight: bold;\">\u5176\u4ed6package\u5b89\u88c5\u547d\u4ee4<\/h3>\n<p>\u8fd0\u884c\u5982\u4e0b\u547d\u4ee4\uff0c\u5217\u51fa\u6240\u6709\u00a0<code class=\"prettyprint\" style=\"color: #333333 !important;\">npm install<\/code>\u00a0\u53ef\u80fd\u7684\u53c2\u6570\u5f62\u5f0f<\/p>\n<div>\n<pre class=\"prettyprint sql\"><code>npm install <span class=\"comment\" style=\"font-style: italic; color: #999988;\">--help<\/span><\/code><\/pre>\n<\/div>\n<p>\u8f93\u51fa\u5982\u4e0b\uff0c\u6709\u5174\u8da3\u7684\u7ae5\u978b\u53ef\u4ee5\u4e86\u89e3\u4e0b<\/p>\n<div>\n<pre class=\"prettyprint xml\"><code>npm install <span class=\"tag\" style=\"color: #000080;\">&lt;<span class=\"title\" style=\"color: #000080;\">tarball<\/span> <span class=\"attribute\" style=\"color: #008080;\">file<\/span>&gt;<\/span><\/code><\/pre>\n<pre class=\"prettyprint xml\"><code>npm install <span class=\"tag\" style=\"color: #000080;\">&lt;<span class=\"title\" style=\"color: #000080;\">tarball<\/span> <span class=\"attribute\" style=\"color: #008080;\">url<\/span>&gt;<\/span><\/code><\/pre>\n<pre class=\"prettyprint xml\"><code>npm install <span class=\"tag\" style=\"color: #000080;\">&lt;<span class=\"title\" style=\"color: #000080;\">folder<\/span>&gt;<\/span><\/code><\/pre>\n<pre class=\"prettyprint xml\"><code>npm install <span class=\"tag\" style=\"color: #000080;\">&lt;<span class=\"title\" style=\"color: #000080;\">pkg<\/span>&gt;<\/span><\/code><\/pre>\n<pre class=\"prettyprint xml\"><code>npm install <span class=\"tag\" style=\"color: #000080;\">&lt;<span class=\"title\" style=\"color: #000080;\">pkg<\/span>&gt;<\/span>@<span class=\"tag\" style=\"color: #000080;\">&lt;<span class=\"title\" style=\"color: #000080;\">tag<\/span>&gt;<\/span><\/code><\/pre>\n<pre class=\"prettyprint xml\"><code>npm install <span class=\"tag\" style=\"color: #000080;\">&lt;<span class=\"title\" style=\"color: #000080;\">pkg<\/span>&gt;<\/span>@<span class=\"tag\" style=\"color: #000080;\">&lt;<span class=\"title\" style=\"color: #000080;\">version<\/span>&gt;<\/span><\/code><\/pre>\n<pre class=\"prettyprint xml\"><code>npm install <span class=\"tag\" style=\"color: #000080;\">&lt;<span class=\"title\" style=\"color: #000080;\">pkg<\/span>&gt;<\/span>@<span class=\"tag\" style=\"color: #000080;\">&lt;<span class=\"title\" style=\"color: #000080;\">version<\/span> <span class=\"attribute\" style=\"color: #008080;\">range<\/span>&gt;<\/span><\/code><\/pre>\n<\/div>\n<h3 style=\"font-weight: bold;\">\u5378\u8f7dgrunt-cli<\/h3>\n<p>\u6bd4\u5982\u5378\u8f7dgrunt-cli<\/p>\n<div>\n<pre class=\"prettyprint undefined\"><code>npm uninstall grunt-cli<\/code><\/pre>\n<\/div>\n<h3 style=\"font-weight: bold;\">\u5378\u8f7d0.1.9\u7248\u672c\u7684grunt-cli<\/h3>\n<div>\n<pre class=\"prettyprint cs\"><code>npm uninstall <a style=\"font-weight: bold; font-style: italic; color: #949494;\" href=\"mailto:grunt-cli@%220.1.9\">grunt-cli<span class=\"string\" style=\"color: #dd1144;\">@\"0.1.9<\/span><\/a><span class=\"string\" style=\"color: #dd1144;\">\"<\/span><\/code><\/pre>\n<\/div>\n<h3 style=\"font-weight: bold;\">npm ls\uff1a\u67e5\u770b\u5b89\u88c5\u4e86\u54ea\u4e9b\u5305<\/h3>\n<p>\u8fd0\u884c\u5982\u4e0b\u547d\u4ee4\uff0c\u5c31\u53ef\u4ee5\u67e5\u770b\u5f53\u524d\u76ee\u5f55\u5b89\u88c5\u4e86\u54ea\u4e9bpackage<\/p>\n<div>\n<pre class=\"prettyprint undefined\"><code>npm ls<\/code><\/pre>\n<\/div>\n<p>\u8f93\u51fa\u5982\u4e0b<\/p>\n<div>\n<pre class=\"prettyprint cs\"><code>\/<span class=\"keyword\" style=\"font-weight: bold;\">private<\/span>\/tmp\/npm<\/code><\/pre>\n<pre class=\"prettyprint ruby\"><code>\u2514\u2500\u252c <a style=\"font-weight: bold; font-style: italic; color: #949494;\" href=\"mailto:grunt-cli@0.1.9\">grunt-cli<span class=\"variable\" style=\"color: #008080;\">@0<\/span>.<span class=\"number\" style=\"color: #009999;\">1.9<\/span><\/a><\/code><\/pre>\n<pre class=\"prettyprint ruby\"><code>\u00a0 \u251c\u2500\u252c <a style=\"font-weight: bold; font-style: italic; color: #949494;\" href=\"mailto:findup-sync@0.1.2\">findup-sync<span class=\"variable\" style=\"color: #008080;\">@0<\/span>.<span class=\"number\" style=\"color: #009999;\">1.2<\/span><\/a><\/code><\/pre>\n<pre class=\"prettyprint perl\"><code>\u00a0 \u2502 \u251c\u2500\u252c <a style=\"font-weight: bold; font-style: italic; color: #949494;\" href=\"mailto:glob@3.1.21\"><span class=\"keyword\" style=\"font-weight: bold;\">glob<\/span><span class=\"variable\" style=\"color: #008080;\">@3<\/span>.<span class=\"number\" style=\"color: #009999;\">1.21<\/span><\/a><\/code><\/pre>\n<pre class=\"prettyprint ruby\"><code>\u00a0 \u2502 \u2502 \u251c\u2500\u2500 <a style=\"font-weight: bold; font-style: italic; color: #949494;\" href=\"mailto:graceful-fs@1.2.3\">graceful-fs<span class=\"variable\" style=\"color: #008080;\">@1<\/span>.<span class=\"number\" style=\"color: #009999;\">2.3<\/span><\/a><\/code><\/pre>\n<pre class=\"prettyprint ruby\"><code>\u00a0 \u2502 \u2502 \u251c\u2500\u2500 <a style=\"font-weight: bold; font-style: italic; color: #949494;\" href=\"mailto:inherits@1.0.0\">inherits<span class=\"variable\" style=\"color: #008080;\">@1<\/span>.<span class=\"number\" style=\"color: #009999;\">0<\/span>.<span class=\"number\" style=\"color: #009999;\">0<\/span><\/a><\/code><\/pre>\n<pre class=\"prettyprint ruby\"><code>\u00a0 \u2502 \u2502 \u2514\u2500\u252c <a style=\"font-weight: bold; font-style: italic; color: #949494;\" href=\"mailto:minimatch@0.2.12\">minimatch<span class=\"variable\" style=\"color: #008080;\">@0<\/span>.<span class=\"number\" style=\"color: #009999;\">2.12<\/span><\/a><\/code><\/pre>\n<pre class=\"prettyprint ruby\"><code>\u00a0 \u2502 \u2502\u00a0\u00a0 \u251c\u2500\u2500 <a style=\"font-weight: bold; font-style: italic; color: #949494;\" href=\"mailto:lru-cache@2.3.0\">lru-cache<span class=\"variable\" style=\"color: #008080;\">@2<\/span>.<span class=\"number\" style=\"color: #009999;\">3.0<\/span><\/a><\/code><\/pre>\n<pre class=\"prettyprint ruby\"><code>\u00a0 \u2502 \u2502\u00a0\u00a0 \u2514\u2500\u2500 <a style=\"font-weight: bold; font-style: italic; color: #949494;\" href=\"mailto:sigmund@1.0.0\">sigmund<span class=\"variable\" style=\"color: #008080;\">@1<\/span>.<span class=\"number\" style=\"color: #009999;\">0<\/span>.<span class=\"number\" style=\"color: #009999;\">0<\/span><\/a><\/code><\/pre>\n<pre class=\"prettyprint ruby\"><code>\u00a0 \u2502 \u2514\u2500\u2500 <a style=\"font-weight: bold; font-style: italic; color: #949494;\" href=\"mailto:lodash@1.0.1\">lodash<span class=\"variable\" style=\"color: #008080;\">@1<\/span>.<span class=\"number\" style=\"color: #009999;\">0<\/span>.<span class=\"number\" style=\"color: #009999;\">1<\/span><\/a><\/code><\/pre>\n<pre class=\"prettyprint ruby\"><code>\u00a0 \u251c\u2500\u252c <a style=\"font-weight: bold; font-style: italic; color: #949494;\" href=\"mailto:nopt@1.0.10\">nopt<span class=\"variable\" style=\"color: #008080;\">@1<\/span>.<span class=\"number\" style=\"color: #009999;\">0<\/span>.<span class=\"number\" style=\"color: #009999;\">10<\/span><\/a><\/code><\/pre>\n<pre class=\"prettyprint ruby\"><code>\u00a0 \u2502 \u2514\u2500\u2500 <a style=\"font-weight: bold; font-style: italic; color: #949494;\" href=\"mailto:abbrev@1.0.4\">abbrev<span class=\"variable\" style=\"color: #008080;\">@1<\/span>.<span class=\"number\" style=\"color: #009999;\">0<\/span>.<span class=\"number\" style=\"color: #009999;\">4<\/span><\/a><\/code><\/pre>\n<pre class=\"prettyprint ruby\"><code>\u00a0 \u2514\u2500\u2500 <a style=\"font-weight: bold; font-style: italic; color: #949494;\" href=\"mailto:resolve@0.3.1\">resolve<span class=\"variable\" style=\"color: #008080;\">@0<\/span>.<span class=\"number\" style=\"color: #009999;\">3.1<\/span><\/a><\/code><\/pre>\n<\/div>\n<p>\u8f93\u51fa\u5982\u4e0b\uff0c\u540c\u6837\uff0c\u5982\u679c\u662f\u8981\u67e5\u770bpackage\u7684\u5168\u5c40\u5b89\u88c5\u4fe1\u606f\uff0c\u52a0\u4e0a\u00a0<code class=\"prettyprint\" style=\"color: #333333 !important;\">-g<\/code>\u00a0\u5c31\u53ef\u4ee5<\/p>\n<h3 style=\"font-weight: bold;\">npm ls pkg\uff1a\u67e5\u770b\u7279\u5b9apackage\u7684\u4fe1\u606f<\/h3>\n<p>\u8fd0\u884c\u5982\u4e0b\u547d\u4ee4\uff0c\u8f93\u51fagrunt-cli\u7684\u4fe1\u606f<\/p>\n<div>\n<pre class=\"prettyprint undefined\"><code>npm ls grunt-cli<\/code><\/pre>\n<\/div>\n<p>\u8f93\u51fa\u7684\u4fe1\u606f\u6bd4\u8f83\u6709\u9650\uff0c\u53ea\u6709\u5b89\u88c5\u76ee\u5f55\u3001\u7248\u672c\uff0c\u5982\u4e0b\uff1a<\/p>\n<div>\n<pre class=\"prettyprint cs\"><code>\/<span class=\"keyword\" style=\"font-weight: bold;\">private<\/span>\/tmp\/npm<\/code><\/pre>\n<pre class=\"prettyprint ruby\"><code>\u2514\u2500\u2500 <a style=\"font-weight: bold; font-style: italic; color: #949494;\" href=\"mailto:grunt-cli@0.1.9\">grunt-cli<span class=\"variable\" style=\"color: #008080;\">@0<\/span>.<span class=\"number\" style=\"color: #009999;\">1.9<\/span><\/a> <\/code><\/pre>\n<\/div>\n<p>\u5982\u679c\u8981\u67e5\u770b\u66f4\u8be6\u7ec6\u4fe1\u606f\uff0c\u53ef\u4ee5\u901a\u8fc7\u00a0<code class=\"prettyprint\" style=\"color: #333333 !important;\">npm info pkg<\/code>\u00a0\uff0c\u8f93\u51fa\u7684\u4fe1\u606f\u975e\u5e38\u8be6\u5c3d\uff0c\u5305\u62ec\u4f5c\u8005\u3001\u7248\u672c\u3001\u4f9d\u8d56\u7b49\u3002<\/p>\n<div>\n<pre class=\"prettyprint undefined\"><code>npm info grunt-cli<\/code><\/pre>\n<\/div>\n<h3 style=\"font-weight: bold;\">npm update pkg\uff1apackage\u66f4\u65b0<\/h3>\n<div>\n<pre class=\"prettyprint sql\"><code>npm <span class=\"operator\"><span class=\"keyword\" style=\"font-weight: bold;\">update<\/span> grunt-cli<\/span><\/code><\/pre>\n<\/div>\n<h3 style=\"font-weight: bold;\">npm search pgk\uff1a\u641c\u7d22<\/h3>\n<p>\u8f93\u5165\u5982\u4e0b\u547d\u4ee4<\/p>\n<div>\n<pre class=\"prettyprint undefined\"><code>npm search grunt-cli<\/code><\/pre>\n<\/div>\n<p>\u8fd4\u56de\u7ed3\u679c\u5982\u4e0b<\/p>\n<div>\n<pre class=\"prettyprint ruby\"><code>npm http <span class=\"constant\">GET<\/span> <a style=\"font-weight: bold; font-style: italic; color: #949494;\" href=\"http:\/\/registry.npmjs.org\/-\/all\/since?stale=update_after&amp;startkey=1375519407838\"><span class=\"symbol\" style=\"color: #990073;\">http:<\/span>\/<span class=\"regexp\" style=\"color: #009926;\">\/registry.npmjs.org\/<\/span>-<span class=\"regexp\" style=\"color: #009926;\">\/all\/since<\/span><span class=\"number\" style=\"color: #009999;\">?s<\/span>tale=update_after&amp;startkey=<span class=\"number\" style=\"color: #009999;\">1375519407838<\/span><\/a><\/code><\/pre>\n<pre class=\"prettyprint ruby\"><code>npm http <span class=\"number\" style=\"color: #009999;\">200<\/span> <a style=\"font-weight: bold; font-style: italic; color: #949494;\" href=\"http:\/\/registry.npmjs.org\/-\/all\/since?stale=update_after&amp;startkey=1375519407838\"><span class=\"symbol\" style=\"color: #990073;\">http:<\/span>\/<span class=\"regexp\" style=\"color: #009926;\">\/registry.npmjs.org\/<\/span>-<span class=\"regexp\" style=\"color: #009926;\">\/all\/since<\/span><span class=\"number\" style=\"color: #009999;\">?s<\/span>tale=update_after&amp;startkey=<span class=\"number\" style=\"color: #009999;\">1375519407838<\/span><\/a><\/code><\/pre>\n<pre class=\"prettyprint undefined\"><code>NAME\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 DESCRIPTION\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 AUTHOR\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 DATE\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 KEYWORDS<\/code><\/pre>\n<pre class=\"prettyprint cs\"><code>grunt-cli\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 The grunt command line <span class=\"keyword\" style=\"font-weight: bold;\">interface<\/span>.\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 =cowboy =tkellen\u00a0 <span class=\"number\" style=\"color: #009999;\">2013<\/span>-<span class=\"number\" style=\"color: #009999;\">07<\/span>-<span class=\"number\" style=\"color: #009999;\">27<\/span> <span class=\"number\" style=\"color: #009999;\">02<\/span>:<span class=\"number\" style=\"color: #009999;\">24<\/span><\/code><\/pre>\n<pre class=\"prettyprint cs\"><code>grunt-cli-dev-exitprocess The grunt command line <span class=\"keyword\" style=\"font-weight: bold;\">interface<\/span>.\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 =dnevnik\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 <span class=\"number\" style=\"color: #009999;\">2013<\/span>-<span class=\"number\" style=\"color: #009999;\">03<\/span>-<span class=\"number\" style=\"color: #009999;\">11<\/span> <span class=\"number\" style=\"color: #009999;\">16<\/span>:<span class=\"number\" style=\"color: #009999;\">19<\/span><\/code><\/pre>\n<pre class=\"prettyprint bash\"><code>grunt-client-compiler Grunt wrapper <span class=\"keyword\" style=\"font-weight: bold;\">for<\/span> client-compiler.\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 =rubenv\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 2013-03-26 09:15\u00a0 gruntplugin<\/code><\/pre>\n<pre class=\"prettyprint cs\"><code>grunt-clientside\u00a0\u00a0\u00a0\u00a0\u00a0 Generate clientside js code <span class=\"keyword\" style=\"font-weight: bold;\">from<\/span> CommonJS modules\u00a0 =jga\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 <span class=\"number\" style=\"color: #009999;\">2012<\/span>-<span class=\"number\" style=\"color: #009999;\">11<\/span>-<span class=\"number\" style=\"color: #009999;\">07<\/span> <span class=\"number\" style=\"color: #009999;\">01<\/span>:<span class=\"number\" style=\"color: #009999;\">20<\/span>\u00a0 gruntplugin<\/code><\/pre>\n<\/div>\n<h3 style=\"font-weight: bold;\">npm\u53d1\u5e03<\/h3>\n<p>\u8fd9\u4e2a\u547d\u4ee4\u6211\u81ea\u5df1\u4e5f\u8fd8\u6ca1\u5b9e\u9645\u7528\u8fc7\uff0c\u4e0d\u8bef\u5bfc\u5927\u5bb6\uff0c\u8bed\u6cd5\u5982\u4e0b\uff0c\u4e5f\u53ef\u53c2\u8003\u5b98\u65b9\u5bf9\u4e8epackage\u53d1\u5e03\u7684\u8bf4\u660e\u00a0<a style=\"font-weight: bold; font-style: italic; color: #949494;\" href=\"https:\/\/npmjs.org\/doc\/developers.html\">https:\/\/npmjs.org\/doc\/developers.html<\/a>\u00a0\uff1a<\/p>\n<div>\n<pre class=\"prettyprint xml\"><code>npm publish <span class=\"tag\" style=\"color: #000080;\">&lt;<span class=\"title\" style=\"color: #000080;\">tarball<\/span>&gt;<\/span><\/code><\/pre>\n<pre class=\"prettyprint xml\"><code>npm publish <span class=\"tag\" style=\"color: #000080;\">&lt;<span class=\"title\" style=\"color: #000080;\">folder<\/span>&gt;<\/span><\/code><\/pre>\n<\/div>\n<div>\n<h2 style=\"font-weight: bold; color: inherit;\">NPM\u914d\u7f6e<\/h2>\n<\/div>\n<p>npm\u7684\u914d\u7f6e\u5de5\u4f5c\u4e3b\u8981\u662f\u901a\u8fc7\u00a0<code class=\"prettyprint\" style=\"color: #333333 !important;\">npm config<\/code>\u00a0\u547d\u4ee4\uff0c\u4e3b\u8981\u5305\u542b\u589e\u3001\u5220\u3001\u6539\u3001\u67e5\u51e0\u4e2a\u6b65\u9aa4\uff0c\u4e0b\u9762\u5c31\u4ee5\u6700\u4e3a\u5e38\u7528\u7684proxy\u914d\u7f6e\u4e3a\u4f8b\u3002<\/p>\n<h3 style=\"font-weight: bold;\">\u8bbe\u7f6eproxy<\/h3>\n<p>\u5185\u7f51\u4f7f\u7528npm\u5f88\u5934\u75db\u7684\u4e00\u4e2a\u95ee\u9898\u5c31\u662f\u4ee3\u7406\uff0c\u5047\u8bbe\u6211\u4eec\u7684\u4ee3\u7406\u662f\u00a0<a style=\"font-weight: bold; font-style: italic; color: #949494;\" href=\"http:\/\/www.cnblogs.com\/chyingp\/p\/http:\/\/proxy.example.com:8080%EF%BC%8C%E9%82%A3%E4%B9%88%E5%91%BD%E4%BB%A4%E5%A6%82%E4%B8%8B%EF%BC%9A\">http:\/\/proxy.example.com:8080\uff0c\u90a3\u4e48\u547d\u4ee4\u5982\u4e0b\uff1a<\/a><\/p>\n<div>\n<pre class=\"prettyprint cs\"><code>npm config <span class=\"keyword\" style=\"font-weight: bold;\">set<\/span> proxy <a style=\"font-weight: bold; font-style: italic; color: #949494;\" href=\"http:\/\/proxy.example.com:8080\/\">http:<span class=\"comment\" style=\"font-style: italic; color: #999988;\">\/\/proxy.example.com:8080<\/span><\/a><\/code><\/pre>\n<\/div>\n<p>\u7531\u4e8e\u00a0<code class=\"prettyprint\" style=\"color: #333333 !important;\">npm config set<\/code>\u00a0\u547d\u4ee4\u6bd4\u8f83\u5e38\u7528\uff0c\u4e8e\u662f\u53ef\u4ee5\u5982\u4e0b\u7b80\u5199<\/p>\n<div>\n<pre class=\"prettyprint cs\"><code>npm <span class=\"keyword\" style=\"font-weight: bold;\">set<\/span> proxy <a style=\"font-weight: bold; font-style: italic; color: #949494;\" href=\"http:\/\/proxy.example.com:8080\/\">http:<span class=\"comment\" style=\"font-style: italic; color: #999988;\">\/\/proxy.example.com:8080<\/span><\/a><span class=\"comment\" style=\"font-style: italic; color: #999988;\">\u00a0\u00a0\u00a0 <\/span><\/code><\/pre>\n<\/div>\n<h3 style=\"font-weight: bold;\">\u67e5\u770bproxy<\/h3>\n<p>\u8bbe\u7f6e\u5b8c\uff0c\u6211\u4eec\u67e5\u770b\u4e0b\u5f53\u524d\u4ee3\u7406\u8bbe\u7f6e<\/p>\n<div>\n<pre class=\"prettyprint cs\"><code>npm config <span class=\"keyword\" style=\"font-weight: bold;\">get<\/span> proxy<\/code><\/pre>\n<\/div>\n<p>\u8f93\u51fa\u5982\u4e0b\uff1a<\/p>\n<div>\n<pre class=\"prettyprint cs\"><code><a style=\"font-weight: bold; font-style: italic; color: #949494;\" href=\"http:\/\/proxy.example.com:8080\/\">http:<span class=\"comment\" style=\"font-style: italic; color: #999988;\">\/\/proxy.example.com:8080\/<\/span><\/a><\/code><\/pre>\n<\/div>\n<p>\u540c\u6837\u53ef\u5982\u4e0b\u7b80\u5199\uff1a<\/p>\n<div>\n<pre class=\"prettyprint cs\"><code>npm <span class=\"keyword\" style=\"font-weight: bold;\">get<\/span> proxy<\/code><\/pre>\n<\/div>\n<h3 style=\"font-weight: bold;\">\u5220\u9664proxy<\/h3>\n<p>\u4ee3\u7406\u4e0d\u9700\u8981\u7528\u5230\u4e86\uff0c\u90a3\u5220\u4e86\u5427<\/p>\n<div>\n<pre class=\"prettyprint sql\"><code>npm <span class=\"operator\"><span class=\"keyword\" style=\"font-weight: bold;\">delete<\/span> proxy<\/span><\/code><\/pre>\n<\/div>\n<h3 style=\"font-weight: bold;\">\u67e5\u770b\u6240\u6709\u914d\u7f6e<\/h3>\n<div>\n<pre class=\"prettyprint php\"><code>npm config <span class=\"keyword\" style=\"font-weight: bold;\">list<\/span><\/code><\/pre>\n<\/div>\n<h3 style=\"font-weight: bold;\">\u76f4\u63a5\u4fee\u6539\u914d\u7f6e\u6587\u4ef6<\/h3>\n<p>\u6709\u65f6\u5019\u89c9\u5f97\u4e00\u6761\u914d\u7f6e\u4e00\u6761\u914d\u7f6e\u5730\u4fee\u6539\u6709\u4e9b\u9ebb\u70e6\uff0c\u5c31\u76f4\u63a5\u8fdb\u914d\u7f6e\u6587\u4ef6\u4fee\u6539\u4e86<\/p>\n<div>\n<pre class=\"prettyprint undefined\"><code>npm config edit<\/code><\/pre>\n<\/div>\n<div>\n<h2 style=\"font-weight: bold; color: inherit;\">\u5173\u4e8epackage.json<\/h2>\n<\/div>\n<p>\u8fd9\u8d27\u5728\u5b98\u7f51\u4f3c\u4e4e\u6ca1\u6709\u8be6\u7ec6\u7684\u63cf\u8ff0\uff0c\u5176\u5b9e\u5c31\u662f\u5305\u7684\u63cf\u8ff0\u4fe1\u606f\u5566\u3002\u5047\u8bbe\u5f53\u6211\u4eec\u4e0b\u8f7d\u4e86node\u5e94\u7528\uff0c\u8fd9\u4e2anode\u5e94\u7528\u4f9d\u8d56\u4e8eA\u3001B\u3001C\u4e09\u4e2a\u5305\uff0c\u5982\u679c\u6ca1\u6709package.json\uff0c\u6211\u4eec\u9700\u8981\u4eba\u8089\u5b89\u88c5\u8fd9\u4e2a\u4e09\u4e2a\u5305\uff08\u5982\u679c\u5bf9\u7248\u672c\u6709\u7279\u5b9a\u8981\u6c42\u5c31\u66f4\u60b2\u5267\u4e86\uff09\uff1a<\/p>\n<div>\n<pre class=\"prettyprint undefined\"><code>npm install A<\/code><\/pre>\n<pre class=\"prettyprint undefined\"><code>npm install B<\/code><\/pre>\n<pre class=\"prettyprint undefined\"><code>npm install C<\/code><\/pre>\n<\/div>\n<p>\u6709\u4e86package.json\uff0c\u4e00\u884c\u547d\u4ee4\u5b89\u88c5\u6240\u6709\u4f9d\u8d56\u3002<\/p>\n<div>\n<pre class=\"prettyprint undefined\"><code>npm install<\/code><\/pre>\n<\/div>\n<h3 style=\"font-weight: bold;\">package.json\u5b57\u6bb5\u7b80\u4ecb<\/h3>\n<p>\u5b57\u6bb5\u76f8\u5f53\u591a\uff0c\u4f46\u6700\u91cd\u8981\u7684\u7684\u662f\u4e0b\u9762\u51e0\u4e2a<\/p>\n<ol>\n<li>name: package\u7684\u540d\u5b57\uff08\u7531\u4e8e\u4ed6\u4f1a\u6210\u4e3aurl\u7684\u4e00\u90e8\u5206\uff0c\u6240\u4ee5 non-url-safe \u7684\u5b57\u6bcd\u4e0d\u4f1a\u901a\u8fc7\uff0c\u4e5f\u4e0d\u5141\u8bb8\u51fa\u73b0&#8221;.&#8221;\u3001&#8221;_&#8221;\uff09\uff0c\u6700\u597d\u5148\u5728\u00a0<a style=\"font-weight: bold; font-style: italic; color: #949494;\" href=\"http:\/\/registry.npmjs.org\/%E4%B8%8A%E6%90%9C%E4%B8%8B%E4%BD%A0%E5%8F%96%E7%9A%84%E5%90%8D%E5%AD%97%E6%98%AF%E5%90%A6%E5%B7%B2%E7%BB%8F%E5%AD%98%E5%9C%A8\">http:\/\/registry.npmjs.org\/\u4e0a\u641c\u4e0b\u4f60\u53d6\u7684\u540d\u5b57\u662f\u5426\u5df2\u7ecf\u5b58\u5728<\/a><\/li>\n<li>version: package\u7684\u7248\u672c\uff0c\u5f53package\u53d1\u751f\u53d8\u5316\u65f6\uff0cversion\u4e5f\u5e94\u8be5\u8ddf\u7740\u4e00\u8d77\u53d8\u5316\uff0c\u540c\u65f6\uff0c\u4f60\u58f0\u660e\u7684\u7248\u672c\u9700\u8981\u901a\u8fc7semver\u7684\u6821\u9a8c\uff08semver\u53ef\u81ea\u884c\u8c37\u6b4c\uff09<\/li>\n<li>dependencies: package\u7684\u5e94\u7528\u4f9d\u8d56\u6a21\u5757\uff0c\u5373\u522b\u4eba\u8981\u4f7f\u7528\u8fd9\u4e2apackage\uff0c\u81f3\u5c11\u9700\u8981\u5b89\u88c5\u54ea\u4e9b\u4e1c\u4e1c\u3002\u5e94\u7528\u4f9d\u8d56\u6a21\u5757\u4f1a\u5b89\u88c5\u5230\u5f53\u524d\u6a21\u5757\u7684node_modules\u76ee\u5f55\u4e0b\u3002<\/li>\n<li>devDependencies\uff1apackage\u7684\u5f00\u53d1\u4f9d\u8d56\u6a21\u5757\uff0c\u5373\u522b\u4eba\u8981\u5728\u8fd9\u4e2apackage\u4e0a\u8fdb\u884c\u5f00\u53d1<\/li>\n<li>\u5176\u4ed6\uff1a\u53c2\u89c1\u5b98\u7f51<\/li>\n<\/ol>\n<div>\n<h2 style=\"font-weight: bold; color: inherit;\">package\u7248\u672c<\/h2>\n<\/div>\n<p>\u5728package.json\u91cc\uff0c\u4f60\u7ecf\u5e38\u4f1a\u5728\u5305\u540d\u540e\u770b\u5230\u7c7b\u4f3c&#8221;~0.1.0&#8243;\u8fd9\u6837\u7684\u5b57\u7b26\u4e32\uff0c\u8fd9\u5c31\u662f\u5305\u7684\u7248\u672c\u5566\u3002\u4e0b\u9762\u4f1a\u5217\u4e3e\u6700\u5e38\u89c1\u7684\u7248\u672c\u58f0\u660e\u5f62\u5f0f\uff0c\u4ee5\u53ca\u7248\u672c\u4e66\u5199\u7684\u8981\u6c42\uff1a<\/p>\n<h3 style=\"font-weight: bold;\">\u5e38\u89c1\u7248\u672c\u58f0\u660e\u5f62\u5f0f<\/h3>\n<p>a\u3001&#8221;~1.2.3&#8243; \u662f\u795e\u9a6c\u610f\u601d\u5462\uff0c\u770b\u4e0b\u9762\u9886\u609f<\/p>\n<div>\n<pre class=\"prettyprint xml\"><code>\"~1.2.3\" = \"&gt;=1.2.3 <span class=\"tag\" style=\"color: #000080;\">&lt;<span class=\"title\" style=\"color: #000080;\">1.3.0\"<\/span><\/span><\/code><\/pre>\n<pre class=\"prettyprint xml\"><code>\"~1.2\" = \"&gt;=1.2.0 <span class=\"tag\" style=\"color: #000080;\">&lt;<span class=\"title\" style=\"color: #000080;\">1.3.0\"<\/span><\/span><\/code><\/pre>\n<pre class=\"prettyprint xml\"><code>\"~1\" = \"&gt;=1.0.0 <span class=\"tag\" style=\"color: #000080;\">&lt;<span class=\"title\" style=\"color: #000080;\">1.1.0\"<\/span><\/span><\/code><\/pre>\n<\/div>\n<p>b\u3001&#8221;1.x.x&#8221;\u662f\u4ec0\u4e48\u610f\u601d\u5462\uff0c\u7ee7\u7eed\u81ea\u884c\u9886\u609f<\/p>\n<div>\n<pre class=\"prettyprint xml\"><code>\"1.2.x\" = \"&gt;=1.2.0 <span class=\"tag\" style=\"color: #000080;\">&lt;<span class=\"title\" style=\"color: #000080;\">1.3.0\"<\/span><\/span><\/code><\/pre>\n<pre class=\"prettyprint xml\"><code>\"1.x.x\" = \"&gt;=1.0.0 <span class=\"tag\" style=\"color: #000080;\">&lt;<span class=\"title\" style=\"color: #000080;\">2.0.0\"<\/span><\/span><\/code><\/pre>\n<pre class=\"prettyprint undefined\"><code>\"1.2\" = \"1.2.x\"<\/code><\/pre>\n<pre class=\"prettyprint undefined\"><code>\"1.x\" = \"1.x.x\"<\/code><\/pre>\n<pre class=\"prettyprint undefined\"><code>\"1\" = \"1.x.x\"<\/code><\/pre>\n<\/div>\n<h3 style=\"font-weight: bold;\">\u7248\u672c\u4e66\u5199\u8981\u6c42<\/h3>\n<ol>\n<li>\u7248\u672c\u53ef\u4ee5v\u5f00\u5934\uff0c\u6bd4\u5982 v1.0.1\uff08v\u53ea\u662f\u53ef\u9009\uff09<\/li>\n<li>1.0.1-7\uff0c\u8fd9\u91cc\u76847\u662f\u6240\u8c13\u7684\u201c\u6784\u5efa\u7248\u672c\u53f7\u201d\uff0c\u4e0d\u7406\u662f\u795e\u9a6c\uff0c\u53cd\u6b63\u7248\u672c\u5927\u4e8e1.0.1<\/li>\n<li>1.0.1beta\uff0c\u6216\u80051.0.1-beta\uff0c\u5982\u679c1.0.1\u540e\u9762\u4e0d\u662f \u201c\u8fde\u5b57\u7b26\u52a0\u6570\u5b57\u201d \u8fd9\u79cd\u5f62\u5f0f\uff0c\u90a3\u4e48\u5b83\u662fpre release \u7248\u672c\uff0c\u5373\u7248\u672c\u5c0f\u4e8e 1.0.1<\/li>\n<li>\u6839\u636eb\u3001c\uff0c\u6709\uff1a0.1.2-7 &gt; 0.1.2-7-beta &gt; 0.1.2-6 &gt; 0.1.2 &gt; 0.1.2beta<\/li>\n<\/ol>\n<div>\n<h2 style=\"font-weight: bold; color: inherit;\">\u5199\u5728\u540e\u9762<\/h2>\n<\/div>\n<p>\u5185\u5bb9\u53ea\u662f\u7b80\u5355\u5730\u628a\u6700\u5e38\u89c1\u7684\u547d\u4ee4\uff0c\u4ee5\u53ca\u4e00\u4e9b\u9700\u8981\u4e86\u89e3\u7684\u5185\u5bb9\u5217\u4e86\u51fa\u6765\u3002\u5982\u8981\u8fdb\u4e00\u6b65\u4e86\u89e3\uff0c\u53ef\u53c2\u8003\u5b98\u7f51\u8bf4\u660e\u3002\u6b64\u5916\uff0c\u00a0<code class=\"prettyprint\" style=\"color: #333333 !important;\">npm help<\/code>\u00a0\u662f\u6211\u4eec\u6700\u597d\u7684\u670b\u53cb\uff0c\u5982\u679c\u5fd8\u4e86\u6709\u54ea\u4e9b\u547d\u4ee4\uff0c\u547d\u4ee4\u4e0b\u6709\u54ea\u4e9b\u53c2\u6570\uff0c\u53ef\u901a\u8fc7help\u8fdb\u884c\u67e5\u770b\u3002<\/p>\n<p>\u6700\u5173\u952e\u7684\uff1a\u5982\u679c\u6587\u7ae0\u5185\u5bb9\u6709\u8bef\uff0c\u8bf7\u6307\u51fa\uff01\uff01\uff01<\/p>\n<p>&nbsp;<\/p>\n<p><a href=\"http:\/\/www.tuicool.com\/articles\/VB7nYn\" target=\"_blank\" rel=\"noopener\">http:\/\/www.tuicool.com\/articles\/VB7nYn<\/a><\/p>\n<p>&nbsp;<\/p>\n<p>&nbsp;<\/p>\n<p>&nbsp;<\/p>\n<p>node \u6a21\u5757\u672c\u5730\u5b89\u88c5 \u79bb\u7ebf\u5b89\u88c5<\/p>\n<h1 class=\"title\" style=\"font-weight: bold; color: blue;\">npm\u7528\u6cd5\u53ca\u79bb\u7ebf\u5b89\u88c5\u65b9\u6cd5<\/h1>\n<h3 style=\"font-weight: bold; color: #ffffff;\">\u57fa\u672c\u7684\u7528\u6cd5<\/h3>\n<p style=\"color: #000000;\">\u67e5\u770b\u67d0\u4e2a\u6a21\u5757\u7684\u5168\u90e8\u4fe1\u606f\uff0c\u6216\u8005\u53ef\u4ee5\u67e5\u770b\u5355\u4e2a\u4fe1\u606f<\/p>\n<pre>npm view jquery versions   \/\/\u67e5\u770b\u53ef\u7528\u7684\u6240\u6709\u7248\u672c<\/pre>\n<div class=\"cnblogs_Highlighter\" style=\"color: #000000;\">\n<div>\n<div id=\"highlighter_152141\" class=\"syntaxhighlighter nogutter javascript\">\n<table style=\"font-weight: normal !important; font-style: normal !important;\" border=\"0\" cellspacing=\"0\" cellpadding=\"0\">\n<tbody style=\"font-weight: normal !important; font-style: normal !important;\">\n<tr style=\"font-weight: normal !important; font-style: normal !important;\">\n<td class=\"code\" style=\"font-weight: normal !important; font-style: normal !important;\">\n<div class=\"container\" style=\"font-weight: normal !important; font-style: normal !important;\">\n<div class=\"line number1 index0 alt2\" style=\"font-weight: normal !important; font-style: normal !important;\"><code class=\"javascript plain\" style=\"font-weight: normal !important; font-style: normal !important; color: #000000 !important;\">npm info name<\/code><\/div>\n<div class=\"line number2 index1 alt1\" style=\"font-weight: normal !important; font-style: normal !important;\"><code class=\"javascript plain\" style=\"font-weight: normal !important; font-style: normal !important; color: #000000 !important;\">npm info name version<\/code><\/div>\n<div class=\"line number3 index2 alt2\" style=\"font-weight: normal !important; font-style: normal !important;\"><code class=\"javascript plain\" style=\"font-weight: normal !important; font-style: normal !important; color: #000000 !important;\">npm info name homepage<\/code><\/div>\n<\/div>\n<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<\/div>\n<\/div>\n<\/div>\n<p style=\"color: #000000;\">install\u652f\u6301\u591a\u79cd\u624b\u6bb5\uff0c\u5305\u540d\uff0cgit\u8def\u5f84\uff0c\u5305\u62ec\u672c\u5730\u8def\u5f84\u4e5f\u53ef\u4ee5<\/p>\n<div class=\"cnblogs_Highlighter\" style=\"color: #000000;\">\n<div>\n<div id=\"highlighter_350994\" class=\"syntaxhighlighter nogutter javascript\">\n<table style=\"font-weight: normal !important; font-style: normal !important;\" border=\"0\" cellspacing=\"0\" cellpadding=\"0\">\n<tbody style=\"font-weight: normal !important; font-style: normal !important;\">\n<tr style=\"font-weight: normal !important; font-style: normal !important;\">\n<td class=\"code\" style=\"font-weight: normal !important; font-style: normal !important;\">\n<div class=\"container\" style=\"font-weight: normal !important; font-style: normal !important;\">\n<div class=\"line number1 index0 alt2\" style=\"font-weight: normal !important; font-style: normal !important;\"><code class=\"javascript plain\" style=\"font-weight: normal !important; font-style: normal !important; color: #000000 !important;\">sudo npm install -global [<\/code><code class=\"javascript keyword\" style=\"font-weight: normal !important; font-style: normal !important; color: #0000ff !important;\">package<\/code>\u00a0<code class=\"javascript plain\" style=\"font-weight: normal !important; font-style: normal !important; color: #000000 !important;\">name]<\/code><\/div>\n<div class=\"line number2 index1 alt1\" style=\"font-weight: normal !important; font-style: normal !important;\"><code class=\"javascript plain\" style=\"font-weight: normal !important; font-style: normal !important; color: #000000 !important;\">npm install git:<\/code><code class=\"javascript comments\" style=\"font-weight: normal !important; font-style: normal !important; color: #008200 !important;\">\/\/github.com\/package\/path.git<\/code><\/div>\n<div class=\"line number3 index2 alt2\" style=\"font-weight: normal !important; font-style: normal !important;\"><code class=\"javascript plain\" style=\"font-weight: normal !important; font-style: normal !important; color: #000000 !important;\">npm install git:<\/code><code class=\"javascript comments\" style=\"font-weight: normal !important; font-style: normal !important; color: #008200 !important;\">\/\/github.com\/package\/path.git#0.1.0<\/code><\/div>\n<div class=\"line number4 index3 alt1\" style=\"font-weight: normal !important; font-style: normal !important;\"><code class=\"javascript plain\" style=\"font-weight: normal !important; font-style: normal !important; color: #000000 !important;\">npm install package_name@version<\/code><\/div>\n<div class=\"line number5 index4 alt2\" style=\"font-weight: normal !important; font-style: normal !important;\"><code class=\"javascript plain\" style=\"font-weight: normal !important; font-style: normal !important; color: #000000 !important;\">npm install path\/to\/somedir\u00a0 <\/code><code class=\"javascript comments\" style=\"font-weight: normal !important; font-style: normal !important; color: #008200 !important;\">\/\/\u672c\u5730\u8def\u5f84<\/code><\/div>\n<\/div>\n<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<\/div>\n<\/div>\n<\/div>\n<p style=\"color: #000000;\">\u524d\u63d0\u662f\u672c\u5730\u8def\u5f84\u91cc\u9762\u5305\u542b\u4e00\u4e2a\u5b8c\u6574\u7684\u5305\uff0c\u6216\u8005\u6587\u4ef6\u91cc\u9762\u6709\u5408\u683c\u7684package.json\u6587\u4ef6\u5373\u53ef<\/p>\n<p style=\"color: #000000;\">\u67e5\u770b\u88c5\u597d\u4e86\u54ea\u4e9b\u5305<\/p>\n<div class=\"cnblogs_Highlighter\" style=\"color: #000000;\">\n<div>\n<div id=\"highlighter_56272\" class=\"syntaxhighlighter nogutter javascript\">\n<table style=\"font-weight: normal !important; font-style: normal !important;\" border=\"0\" cellspacing=\"0\" cellpadding=\"0\">\n<tbody style=\"font-weight: normal !important; font-style: normal !important;\">\n<tr style=\"font-weight: normal !important; font-style: normal !important;\">\n<td class=\"code\" style=\"font-weight: normal !important; font-style: normal !important;\">\n<div class=\"container\" style=\"font-weight: normal !important; font-style: normal !important;\">\n<div class=\"line number1 index0 alt2\" style=\"font-weight: normal !important; font-style: normal !important;\"><code class=\"javascript plain\" style=\"font-weight: normal !important; font-style: normal !important; color: #000000 !important;\">npm list<\/code><\/div>\n<div class=\"line number2 index1 alt1\" style=\"font-weight: normal !important; font-style: normal !important;\"><code class=\"javascript plain\" style=\"font-weight: normal !important; font-style: normal !important; color: #000000 !important;\">npm -global list<\/code><\/div>\n<\/div>\n<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<\/div>\n<\/div>\n<\/div>\n<h3 style=\"font-weight: bold; color: #ffffff;\">\u914d\u7f6e\u6587\u4ef6\u57fa\u672c\u7528\u6cd5<\/h3>\n<div style=\"color: #000000;\">\u914d\u7f6e\u5c31\u662f\u4fee\u6539npmrc\u6587\u4ef6\u4e86\u3002\u7528\u547d\u4ee4\u884c\u540c\u6837\u4e5f\u662f\u4fee\u6539\u6b64\u6587\u4ef6\u3002<\/div>\n<div style=\"color: #000000;\">npmrc\u5b58\u5728\u4e09\u4e2a\u4f4d\u7f6e\uff0c\u4fee\u6539\u7528\u6237\u76ee\u5f55\u4e0b\u7684\u6587\u4ef6\u5c31\u66f4\u5408\u9002\u4e86\u3002<\/div>\n<div style=\"color: #000000;\">~\/.npmrc \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \uff08\u7528\u6237\u4e3b\u76ee\u5f55\uff0cwin\u7cfb\u7edf\u5728C:\\Users\\$\u7528\u6237\u540d\\.npmrc\uff09<\/div>\n<div style=\"color: #000000;\"><\/div>\n<p style=\"color: #000000;\">\u4fee\u6539\u6587\u4ef6\u5c31\u4e0d\u7528\u8bf4\u4e86\uff0c\u547d\u4ee4\u914d\u7f6e\u65b9\u6cd5<\/p>\n<div class=\"cnblogs_Highlighter\" style=\"color: #000000;\">\n<div>\n<div id=\"highlighter_586691\" class=\"syntaxhighlighter nogutter javascript\">\n<table style=\"font-weight: normal !important; font-style: normal !important;\" border=\"0\" cellspacing=\"0\" cellpadding=\"0\">\n<tbody style=\"font-weight: normal !important; font-style: normal !important;\">\n<tr style=\"font-weight: normal !important; font-style: normal !important;\">\n<td class=\"code\" style=\"font-weight: normal !important; font-style: normal !important;\">\n<div class=\"container\" style=\"font-weight: normal !important; font-style: normal !important;\">\n<div class=\"line number1 index0 alt2\" style=\"font-weight: normal !important; font-style: normal !important;\"><code class=\"javascript plain\" style=\"font-weight: normal !important; font-style: normal !important; color: #000000 !important;\">npm config set key=value<\/code><\/div>\n<div class=\"line number2 index1 alt1\" style=\"font-weight: normal !important; font-style: normal !important;\"><code class=\"javascript plain\" style=\"font-weight: normal !important; font-style: normal !important; color: #000000 !important;\">npm config set proxy=http:<\/code><code class=\"javascript comments\" style=\"font-weight: normal !important; font-style: normal !important; color: #008200 !important;\">\/\/127.0.0.1:8087<\/code><\/div>\n<\/div>\n<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<\/div>\n<\/div>\n<\/div>\n<p style=\"color: #000000;\">\u5177\u4f53\u7684\u7528\u6cd5\u548c\u5177\u4f53key value\u53ef\u4ee5\u901a\u8fc7\u6253\u5f00\u8bf4\u660e\u6587\u6863\u67e5\u770b<\/p>\n<div class=\"cnblogs_Highlighter\" style=\"color: #000000;\">\n<div>\n<div id=\"highlighter_177457\" class=\"syntaxhighlighter nogutter javascript\">\n<table style=\"font-weight: normal !important; font-style: normal !important;\" border=\"0\" cellspacing=\"0\" cellpadding=\"0\">\n<tbody style=\"font-weight: normal !important; font-style: normal !important;\">\n<tr style=\"font-weight: normal !important; font-style: normal !important;\">\n<td class=\"code\" style=\"font-weight: normal !important; font-style: normal !important;\">\n<div class=\"container\" style=\"font-weight: normal !important; font-style: normal !important;\">\n<div class=\"line number1 index0 alt2\" style=\"font-weight: normal !important; font-style: normal !important;\"><code class=\"javascript plain\" style=\"font-weight: normal !important; font-style: normal !important; color: #000000 !important;\">npm help npm<\/code><\/div>\n<\/div>\n<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<\/div>\n<\/div>\n<\/div>\n<p style=\"color: #000000;\">\u914d\u7f6e\u9879\u53ef\u4ee5\u901a\u8fc7\u4ee5\u4e0b\u547d\u4ee4\u67e5\u770b\u5df2\u7ecf\u914d\u7f6e\u8fc7\u7684\u9879<\/p>\n<div class=\"cnblogs_Highlighter\" style=\"color: #000000;\">\n<div>\n<div id=\"highlighter_803765\" class=\"syntaxhighlighter nogutter javascript\">\n<table style=\"font-weight: normal !important; font-style: normal !important;\" border=\"0\" cellspacing=\"0\" cellpadding=\"0\">\n<tbody style=\"font-weight: normal !important; font-style: normal !important;\">\n<tr style=\"font-weight: normal !important; font-style: normal !important;\">\n<td class=\"code\" style=\"font-weight: normal !important; font-style: normal !important;\">\n<div class=\"container\" style=\"font-weight: normal !important; font-style: normal !important;\">\n<div class=\"line number1 index0 alt2\" style=\"font-weight: normal !important; font-style: normal !important;\"><code class=\"javascript plain\" style=\"font-weight: normal !important; font-style: normal !important; color: #000000 !important;\">npm config list<\/code><\/div>\n<div class=\"line number2 index1 alt1\" style=\"font-weight: normal !important; font-style: normal !important;\"><code class=\"javascript plain\" style=\"font-weight: normal !important; font-style: normal !important; color: #000000 !important;\">npm config list -l<\/code><\/div>\n<\/div>\n<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<\/div>\n<\/div>\n<\/div>\n<h3 style=\"font-weight: bold; color: #ffffff;\">\u914d\u7f6e\u4ee3\u7406\uff0c\u5168\u5c40\u76ee\u5f55\uff0c\u6e90<\/h3>\n<p style=\"color: #000000;\">\u4e0b\u9762\u6b63\u5f0f\u4ecb\u7ecd\u5bf9\u4ed8\u56fd\u5185\u7f51\u7edc\u7684\u65b9\u6cd5\u4e86<\/p>\n<p style=\"color: #000000;\">\u9996\u5148\u51e0\u4e2a\u91cd\u8981\u7684\u914d\u7f6e\u9879\u4e00\u4e00\u4ecb\u7ecd<\/p>\n<p style=\"color: #000000;\">prefix \u00a0 &#8212; \u5168\u5c40\u5b89\u88c5\u7684\u8def\u5f84\uff0c\u4e5f\u5c31\u662fnpm install -g \u5b89\u88c5\u7684\u6a21\u5757\u5728\u54ea\u4e2a\u4f4d\u7f6e\u3002\u8fd9\u4e2a\u770b\u4e2a\u4eba\u559c\u597d\u3002\u6211\u559c\u597d\u5c06\u4ed6\u8bbe\u7f6e\u5230\u5b89\u88c5\u8def\u5f84\u4e0b\u9762\u3002<\/p>\n<p style=\"color: #000000;\">proxy &#8212; \u4ee3\u7406\uff08http\u7684\u4ee3\u7406\u662f\u7528\u8fd9\u4e2a\uff09\uff0c\u4ee3\u7406\u8fde\u5916\u7f51\u7684\u670b\u53cb\u8fd9\u4e2a\u5c31\u9700\u8981\u914d\u7f6e\u4e86\u3002<\/p>\n<p style=\"color: #000000;\">https_proxy &#8212; https\u4ee3\u7406<\/p>\n<p style=\"color: #000000;\">registry &#8212; \u7c7b\u4f3clinux\u7684\u8f6f\u4ef6\u6e90\uff0c\u8fd9\u4e2a\u4e00\u5b9a\u8981\u4fee\u6539\u7684<\/p>\n<div class=\"cnblogs_Highlighter\" style=\"color: #000000;\">\n<div>\n<div id=\"highlighter_385540\" class=\"syntaxhighlighter nogutter javascript\">\n<table style=\"font-weight: normal !important; font-style: normal !important;\" border=\"0\" cellspacing=\"0\" cellpadding=\"0\">\n<tbody style=\"font-weight: normal !important; font-style: normal !important;\">\n<tr style=\"font-weight: normal !important; font-style: normal !important;\">\n<td class=\"code\" style=\"font-weight: normal !important; font-style: normal !important;\">\n<div class=\"container\" style=\"font-weight: normal !important; font-style: normal !important;\">\n<div class=\"line number1 index0 alt2\" style=\"font-weight: normal !important; font-style: normal !important;\"><code class=\"javascript plain\" style=\"font-weight: normal !important; font-style: normal !important; color: #000000 !important;\">npm config set prefix <\/code><code class=\"javascript string\" style=\"font-weight: normal !important; font-style: normal !important; color: blue !important;\">\"c:\\nodejs\"<\/code><\/div>\n<div class=\"line number2 index1 alt1\" style=\"font-weight: normal !important; font-style: normal !important;\"><code class=\"javascript plain\" style=\"font-weight: normal !important; font-style: normal !important; color: #000000 !important;\">npm config set proxy=http:<\/code><code class=\"javascript comments\" style=\"font-weight: normal !important; font-style: normal !important; color: #008200 !important;\">\/\/127.0.0.1:8087<\/code><\/div>\n<div class=\"line number3 index2 alt2\" style=\"font-weight: normal !important; font-style: normal !important;\"><code class=\"javascript plain\" style=\"font-weight: normal !important; font-style: normal !important; color: #000000 !important;\">npm config set https_proxy=http:<\/code><code class=\"javascript comments\" style=\"font-weight: normal !important; font-style: normal !important; color: #008200 !important;\">\/\/127.0.0.1:8087<\/code><\/div>\n<div class=\"line number4 index3 alt1\" style=\"font-weight: normal !important; font-style: normal !important;\"><code class=\"javascript plain\" style=\"font-weight: normal !important; font-style: normal !important; color: #000000 !important;\">npm config set registry=http:<\/code><code class=\"javascript comments\" style=\"font-weight: normal !important; font-style: normal !important; color: #008200 !important;\">\/\/registry.npmjs.org<\/code><\/div>\n<\/div>\n<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<\/div>\n<\/div>\n<\/div>\n<div style=\"color: #000000;\">\n<div id=\"highlighter_51146\" class=\"syntaxhighlighter nogutter javascript\">\n<table style=\"font-weight: normal !important; font-style: normal !important;\" border=\"0\" cellspacing=\"0\" cellpadding=\"0\">\n<tbody style=\"font-weight: normal !important; font-style: normal !important;\">\n<tr style=\"font-weight: normal !important; font-style: normal !important;\">\n<td class=\"code\" style=\"font-weight: normal !important; font-style: normal !important;\"><\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<\/div>\n<\/div>\n<p style=\"color: #000000;\">registry=http:\/\/registry.npmjs.org \u8fd9\u53e5\u5f88\u91cd\u8981\uff0c\u6ce8\u610f\u9ed8\u8ba4\u7684\u6e90\u662fhttps:\/\/registry.npmjs.org \u662fhttps\u7684\uff0c\u53cd\u6b63\u6211\u8fde\u9ed8\u8ba4\u7684\u6e90\u662f\u4ece\u6765\u6ca1\u6210\u529f\u8fc7\u4e00\u6b21\u3002<br \/>\n\u4e0a\u4f8b\u6211\u628a\u4ed6\u4fee\u6b63\u4e3a\u4e0d\u52a0\u5bc6http\u7684\u5c31\u57fa\u672c\u80fd\u6b63\u5e38\u4e86\u3002<\/p>\n<p style=\"color: #000000;\">\u7f51\u7edc\u4e0d\u884c\u53ef\u4ee5\u8003\u8651\u4e00\u4e9b\u56fd\u5185\u7684\u6e90\u8bd5\u8bd5\uff0c\u4f8b\u5982<\/p>\n<div class=\"cnblogs_Highlighter\" style=\"color: #000000;\">\n<div>\n<div id=\"highlighter_157231\" class=\"syntaxhighlighter nogutter javascript\">\n<table style=\"font-weight: normal !important; font-style: normal !important;\" border=\"0\" cellspacing=\"0\" cellpadding=\"0\">\n<tbody style=\"font-weight: normal !important; font-style: normal !important;\">\n<tr style=\"font-weight: normal !important; font-style: normal !important;\">\n<td class=\"code\" style=\"font-weight: normal !important; font-style: normal !important;\">\n<div class=\"container\" style=\"font-weight: normal !important; font-style: normal !important;\">\n<div class=\"line number1 index0 alt2\" style=\"font-weight: normal !important; font-style: normal !important;\"><code class=\"javascript plain\" style=\"font-weight: normal !important; font-style: normal !important; color: #000000 !important;\">npm config set registry <\/code><code class=\"javascript string\" style=\"font-weight: normal !important; font-style: normal !important; color: blue !important;\">\"<a style=\"font-weight: normal !important; font-style: normal !important; color: blue !important;\" href=\"http:\/\/r.cnpmjs.org\/\">http:\/\/r.cnpmjs.org\/<\/a>\"<\/code><\/div>\n<\/div>\n<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<\/div>\n<\/div>\n<\/div>\n<h3 style=\"font-weight: bold; color: #ffffff;\">\u79bb\u7ebf\u5b89\u88c5<\/h3>\n<p style=\"color: #000000;\">\u6709\u8bb8\u591a\u73af\u5883\u4e0b\u5373\u4fbf\u914d\u7f6e\u4e86\u4ee3\u7406\uff0c\u4fee\u6539\u4e86\u6e90\u8fd8\u662f\u51fa\u73b0\u7f51\u7edc\u95ee\u9898\u3002\u5e38\u89c1\u7684\u63d0\u793a\u662fshasum check failed\u3002\u5f53\u7136\u8fd9\u4e0d\u4e00\u5b9a\u5c31\u662f\u7f51\u7edc\u4e0d\u884c\uff0c\u4f46\u5927\u90e8\u5206\u60c5\u51b5\u4e0b\u662f\u7f51\u7edc\u8fde\u63a5\u4e0d\u901a\u7545\u5bfc\u81f4\u7684\u3002<\/p>\n<p style=\"color: #000000;\">\u8fd9\u79cd\u60c5\u51b5\u4e0b\u53ef\u4ee5\u624b\u5de5\u4e0b\u8f7d\u5e76\u5b89\u88c5\uff0c\u5176\u5b9e\u4e5f\u5f88\u7b80\u5355\u3002<\/p>\n<p style=\"color: #000000;\">\u9996\u5148\u627e\u5230\u60f3\u529e\u6cd5\u628a\u4f60\u9700\u8981\u7684\u5305\u4e0b\u8f7d\u4e0b\u6765\uff0c\u8fd9\u4e2a\u53ef\u4ee5\u591a\u79cd\u529e\u6cd5\u4e86\u3002\u6216\u8005\u4ece\u5176\u4ed6\u673a\u5668\u62f7\u8fc7\u6765\u3002<\/p>\n<p style=\"color: #000000;\">\u4f8b\u5982\u5148npm info mysql \u67e5\u770bmysql\u8fd9\u4e2a\u5305\u7684\u4fe1\u606f\uff0c\u5305\u4fe1\u606f\u91cc\u9762\u4f1a\u6709\u8f6f\u4ef6\u4e3b\u9875\u6216\u8005\u4ee3\u7801\u4ed3\u5e93\u5730\u5740\u3002\u4e00\u534a\u5728github\u4e0a\u3002\uff08install\u56e0\u4e3a\u8981\u4e0b\u8f7d\u53ef\u80fd\u4f1a\u5931\u8d25\uff0c\u4f46\u662finfo\u6307\u4ee4\u4fe1\u606f\u5c11\u901a\u5e38\u53ef\u4ee5\u6210\u529f\uff09\u3002<\/p>\n<p style=\"color: #000000;\">\u4f8b\u5982node-mysql\u7684\u5730\u5740\u5728<a style=\"color: black;\" href=\"https:\/\/github.com\/felixge\/node-mysql\">https:\/\/github.com\/felixge\/node-mysql<\/a><\/p>\n<p style=\"color: #000000;\">\u4e0b\u8f7d\u6765\u4e4b\u540e\u89e3\u538b\u5230\u5de5\u7a0b\u7684node_modules\u76ee\u5f55\u4e0b\u5c31\u662f\u5b89\u88c5\u597d\u4e86\uff0c\u5c31\u8fd9\u4e48\u7b80\u5355\u3002<\/p>\n<p style=\"color: #000000;\">Project<\/p>\n<p style=\"color: #000000;\">\u3000\u3000&#8212;package.json<\/p>\n<p style=\"color: #000000;\">\u3000\u3000&#8212;index.js<\/p>\n<p style=\"color: #000000;\">\u3000\u3000&#8212;node_modules \u00a0 \u00a0 \u00a0\/\/ \u89e3\u538b\u5230\u6b64\u76ee\u5f55\u5c31\u884c\u4e86\uff08\u6bcf\u4e2a\u5305\u6587\u4ef6\u5939\u4e0b\u9762\u6709package.json\uff0cindex.js\u6587\u4ef6\u7684\u3002\uff09<\/p>\n<p style=\"color: #000000;\">\u6ce8\u610f\uff1a\u4f60\u4e0b\u8f7d\u4e0b\u6765\u7684\u6e90\u7801\u5305\u53ef\u80fd\u548c\u6a21\u5757\u540d\u5b57\u4e0d\u4e00\u6837\u3002\u8981\u5c06\u6539\u540d\u6210\u6a21\u5757\u540d\u518d\u62f7\u8d1d\u8fdbnode_modules \u4e2d\u53bb\u3002\u4f8b\u5982\u5c06node-mysql\u6587\u4ef6\u5939\u6539\u540d\u6210mysql\u3002<\/p>\n<p style=\"color: #000000;\">\u5305\u4e4b\u95f4\u7684\u4f9d\u8d56\u5173\u7cfb\u79bb\u7ebf\u5b89\u88c5\u95ee\u9898<\/p>\n<p style=\"color: #000000;\">\u4e0a\u9762\u65b9\u6cd5\u5b89\u88c5\u7684\u5305\u4e0d\u4f1a\u5305\u542b\u4f9d\u8d56\u7684\u5305\uff0c\u4e0d\u8fc7\u4f9d\u8d56\u5305\u540c\u6837\u7528\u4e0a\u9762\u79bb\u7ebf\u4e00\u4e2a\u4e2a\u5b89\u88c5\u7684\u529e\u6cd5\u4e5f\u53ef\u4ee5\u3002<\/p>\n<p style=\"color: #000000;\">\u4f8b\u5982mysql\u5305\u5c31\u4f9d\u8d56bignumber.js ,\u00a0readable-stream ,\u00a0require-all \u4e09\u4e2a\u5305\u3002npm\u9ed8\u8ba4\u60c5\u51b5\u4e0b\u5b89\u88c5\u7684\u4f9d\u8d56\u5305\u4f1a\u662f\u4e00\u5c42\u4e00\u5c42\u5f80\u4e0b\u7684\u3002\u4f8b\u5982\u5b89\u88c5\u597dmysql\u5de5\u7a0b\u7ed3\u6784\u4f1a\u662f\u8fd9\u6837\u7684<\/p>\n<p style=\"color: #000000;\">Project<\/p>\n<p style=\"color: #000000;\">\u3000\u3000&#8212;package.json<\/p>\n<p style=\"color: #000000;\">\u3000\u3000&#8212;index.js<\/p>\n<p style=\"color: #000000;\">\u3000\u3000&#8212;node_modules<\/p>\n<p style=\"color: #000000;\">\u3000\u3000\u3000\u3000\u3000\u3000&#8212;mysql<\/p>\n<p style=\"color: #000000;\">\u3000\u3000\u3000\u3000\u3000\u3000\u3000\u3000\u3000\u3000&#8212;node_modules<\/p>\n<p style=\"color: #000000;\">\u3000\u3000\u3000\u3000\u3000\u3000\u3000\u3000\u3000\u3000\u3000\u3000\u3000\u3000&#8212;bignumber.js<\/p>\n<p style=\"color: #000000;\">\u3000\u3000\u3000\u3000\u3000\u3000\u3000\u3000\u3000\u3000\u3000\u3000\u3000\u3000&#8212;readable-stream<\/p>\n<p style=\"color: #000000;\">\u3000\u3000\u3000\u3000\u3000\u3000\u3000\u3000\u3000\u3000\u3000\u3000\u3000\u3000&#8212;require-all<\/p>\n<p style=\"color: #000000;\">\u4f60\u540c\u6837\u53ea\u9700\u8981\u76f8\u540c\u7684\u64cd\u4f5c\u5c06\u4f9d\u8d56\u7684\u5305\u653e\u5230\u76f8\u5e94\u7684\u4f4d\u7f6e\u4fbf\u53ef\u3002\u8fd9\u6837\u5305\u7ba1\u7406\u7684\u7ed3\u6784\u867d\u7136\u590d\u6742\u4f46\u662f\u4f9d\u8d56\u5173\u7cfb\u5f88\u6e05\u6670\u3002\u4f46\u662f\u8fd9\u4e2a\u89c4\u5b9a\u4e0d\u4e00\u5b9a\u975e\u8981\u8fd9\u6837\uff0c\u4f60\u4e5f\u53ef\u4ee5\u5c06\u4f9d\u8d56\u5305\u653e\u5230\u7b2c\u4e00\u5c42\u7684node_modules\u6587\u4ef6\u5939\u4e0b\u3002nodejs\u641c\u7d22\u6a21\u5757\u8def\u5f84\u4f1a\u4e00\u5c42\u4e00\u5c42\u5f80\u4e0a\u641c\u7d22\u3002<\/p>\n<p><a href=\"http:\/\/www.cnblogs.com\/laozhbook\/p\/npm_help.html\" target=\"_blank\" rel=\"noopener\">http:\/\/www.cnblogs.com\/laozhbook\/p\/npm_help.html<\/a><\/p>\n<p>&nbsp;<\/p>\n<p>&nbsp;<\/p>\n<p>&nbsp;<\/p>\n<p><audio style=\"display: none;\" controls=\"controls\"><\/audio><\/p>\n","protected":false},"excerpt":{"rendered":"<p>\u5173\u4e8e\u73af\u5883\u53d8\u91cf\u7684\u8bbe\u7f6e\u8bf7\u770b\uff1ahttps:\/\/sdeno.com\/?p=4740 nodejs\u7684\u51fa\u73b0\uff0c\u53ef\u4ee5\u7b97\u662f\u524d\u7aef\u91cc [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[35],"tags":[],"class_list":["post-4892","post","type-post","status-publish","format-standard","hentry","category-nodejs"],"_links":{"self":[{"href":"https:\/\/sdeno.com\/index.php?rest_route=\/wp\/v2\/posts\/4892","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/sdeno.com\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/sdeno.com\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/sdeno.com\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/sdeno.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=4892"}],"version-history":[{"count":0,"href":"https:\/\/sdeno.com\/index.php?rest_route=\/wp\/v2\/posts\/4892\/revisions"}],"wp:attachment":[{"href":"https:\/\/sdeno.com\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=4892"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/sdeno.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=4892"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/sdeno.com\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=4892"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}