{"id":4421,"date":"2015-11-18T21:50:41","date_gmt":"2015-11-18T13:50:41","guid":{"rendered":"https:\/\/sdeno.com\/?p=4421"},"modified":"2016-07-04T20:53:29","modified_gmt":"2016-07-04T12:53:29","slug":"nodejs-npm-install%e5%85%a8%e5%b1%80%e5%ae%89%e8%a3%85%e5%92%8c%e6%9c%ac%e5%9c%b0%e5%ae%89%e8%a3%85%e7%9a%84%e5%8c%ba%e5%88%ab","status":"publish","type":"post","link":"https:\/\/sdeno.com\/?p=4421","title":{"rendered":"nodejs npm install\u5168\u5c40\u5b89\u88c5\u548c\u672c\u5730\u5b89\u88c5\u7684\u533a\u522b"},"content":{"rendered":"<p>npm nodejs \u5b89\u88c5 \u5168\u5c40<\/p>\n<p>\u5728Git Bash\u547d\u4ee4\u4e0b\u5b89\u88c5\u4e00\u4e9bnodejs\u6269\u5c55\u529f\u80fd\u603b\u80fd\u5728\u7f51\u4e0a\u770b\u5230\uff0c\u662f\u5426\u8981\u5b89\u88c5\u4e3a\u5168\u5c40\u6216\u8005\u672c\u5730\u3002<\/p>\n<p>\u5176\u5b9e\u5168\u5c40\u548c\u672c\u5730\u7684\u6982\u5ff5\u8ddf\u6211\u4eec\u5b66\u4e60js\u7684\u5168\u5c40\u548c\u5c40\u90e8\u7684\u6982\u5ff5\u4e00\u6837\u3002\u5b89\u88c5\u5728\u5168\u5c40\u76ee\u5f55\u4e0b\u6211\u4eec\u968f\u65f6\u90fd\u80fd\u8c03\u7528\u6b64\u6269\u5c55\u7684\u529f\u80fd\uff0c\u800c\u672c\u5730\u53ea\u80fd\u662f\u8fd9\u4e2a\u76ee\u5f55\u4e0b\u624d\u80fd\u4f7f\u7528\u3002<\/p>\n<p>\u770b\u770b\u5168\u5c40\u548c\u672c\u5730\u5b89\u88c5\u7684\u547d\u4ee4\u533a\u522b\uff1a<\/p>\n<pre>npm install grunt \/\/ \u672c\u5730\u5b89\u88c5\r\nnpm install -g grunt-cli \/\/ \u5168\u5c40\u5b89\u88c5<\/pre>\n<p>\u4ece\u6572\u7684\u547d\u4ee4\u884c\u6765\u770b\uff0c\u5dee\u522b\u53ea\u662f\u6709\u6ca1\u6709-g\u800c\u5df2<\/p>\n<p>&nbsp;<\/p>\n<p>1\uff0cnpm install xxx -g \u65f6\uff0c \u6a21\u5757\u5c06\u88ab\u4e0b\u8f7d\u5b89\u88c5\u5230\u3010\u5168\u5c40\u76ee\u5f55\u3011\u4e2d\u3002<\/p>\n<p>\u67e5\u770b\u5168\u5c40\u5b89\u88c5\u76ee\u5f55\uff1a<\/p>\n<pre>npm config get prefix<\/pre>\n<p>&nbsp;<\/p>\n<p>\u4fee\u6539\u5168\u5c40\u76ee\u5f55\uff1a<\/p>\n<pre>npm config set prefix \"\u76ee\u5f55\u8def\u5f84\"<\/pre>\n<p>&nbsp;<\/p>\n<p>2\uff0cnpm install xxx \uff0c\u5219\u662f\u5c06\u6a21\u5757\u4e0b\u8f7d\u5230\u5f53\u524d\u547d\u4ee4\u884c\u6240\u5728\u76ee\u5f55\u3002<\/p>\n<pre>c:\\123&gt;npm install xxx   \/\/\u6a21\u5757\u5b89\u88c5\u5728 c:\\123\u76ee\u5f55\u4e0b<\/pre>\n<p>\u5c06\u4f1a\u5b89\u88c5\u5230<\/p>\n<pre>c:\\123\\node_modules\\xxx<\/pre>\n<p>\u8fd9\u79cd\u65b9\u5f0f\u663e\u7136\u662f\u4e0d\u597d\u7684\uff0c\u6240\u4ee5\u4e00\u822c\u90fd\u4f1a\u4f7f\u7528\u5168\u5c40\u5b89\u88c5\u65b9\u5f0f\u7edf\u4e00\u5b89\u88c5\u7684\u4e00\u4e2a\u76ee\u5f55\u4e2d\u53bb,\u8fd9\u6837\u65e2\u65b9\u4fbf\u7ba1\u7406\u3001\u7ed3\u6784\u6e05\u6670\u8fd8\u53ef\u4ee5\u91cd\u590d\u5229\u7528\u3002<\/p>\n<p><a href=\"http:\/\/www.jb51.net\/article\/50669.htm\" target=\"_blank\">http:\/\/www.jb51.net\/article\/50669.htm<\/a><\/p>\n","protected":false},"excerpt":{"rendered":"<p>npm nodejs \u5b89\u88c5 \u5168\u5c40 \u5728Git Bash\u547d\u4ee4\u4e0b\u5b89\u88c5\u4e00\u4e9bnodejs\u6269\u5c55\u529f\u80fd\u603b\u80fd\u5728\u7f51\u4e0a\u770b\u5230\uff0c\u662f\u5426\u8981\u5b89 [&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,11],"tags":[],"class_list":["post-4421","post","type-post","status-publish","format-standard","hentry","category-nodejs","category-11"],"_links":{"self":[{"href":"https:\/\/sdeno.com\/index.php?rest_route=\/wp\/v2\/posts\/4421","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=4421"}],"version-history":[{"count":0,"href":"https:\/\/sdeno.com\/index.php?rest_route=\/wp\/v2\/posts\/4421\/revisions"}],"wp:attachment":[{"href":"https:\/\/sdeno.com\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=4421"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/sdeno.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=4421"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/sdeno.com\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=4421"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}