{"id":5348,"date":"2018-07-03T21:54:13","date_gmt":"2018-07-03T12:54:13","guid":{"rendered":"http:\/\/www.code-magagine.com\/?p=5348"},"modified":"2023-05-27T21:03:57","modified_gmt":"2023-05-27T12:03:57","slug":"npm%e3%81%a8%e3%81%af%ef%bc%9f","status":"publish","type":"post","link":"http:\/\/www.code-magagine.com\/?p=5348","title":{"rendered":"\u3010JavaScript\u3011npm\u3068\u306f\uff1f"},"content":{"rendered":"<p>Node.js\u3068\u3044\u3046\u30b5\u30fc\u30d0\u30fc\u30b5\u30a4\u30c9\u3067\u52d5\u304fJavaScript\u3092\u52d5\u4f5c\u3055\u305b\u308b\u305f\u3081\u306e\u30d1\u30c3\u30b1\u30fc\u30b8\u7ba1\u7406\u30c4\u30fc\u30eb\u306e\u3053\u3068\u3067\u3059\u3002<\/p>\n<h2>npm\u306e\u30e1\u30ea\u30c3\u30c8<\/h2>\n<p>Node.js\u306e\u958b\u767a\u8005\u306e\u4eba\u6570\u306f\u591a\u304f\u3001\u5927\u91cf\u306e\u30e9\u30a4\u30d6\u30e9\u30ea\u3084\u3001\u8cc7\u6599\u304c\u7528\u610f\u3055\u308c\u3066\u3044\u307e\u3059\u3002\u30dc\u30e9\u30f3\u30c6\u30a3\u30a2\u304c\u4f5c\u6210\u3057\u305f\u5927\u91cf\u306e\u30aa\u30fc\u30d7\u30f3\u30bd\u30fc\u30b9\u30e9\u30a4\u30d6\u30e9\u30ea\u3092\u5229\u7528\u3059\u308b\u3053\u3068\u304c\u53ef\u80fd\u3067\u3059\u3002<\/p>\n<h2>Windows\u3067\u306enpm\u306e\u30a4\u30f3\u30b9\u30c8\u30fc\u30eb\u65b9\u6cd5<\/h2>\n<p>\u4e0b\u8a18\u306e\u30b5\u30a4\u30c8\u3067\u3001Node.js\u306e\u30a4\u30f3\u30b9\u30c8\u30fc\u30e9\u3092\u30c0\u30a6\u30f3\u30ed\u30fc\u30c9\u3057\u307e\u3059\u3002<\/p>\n<p>https:\/\/nodejs.org\/ja\/<\/p>\n<p>\u4e0b\u8a18\u306e\u3088\u3046\u306b\u3001\u300cnpm -v\u300d\u3068\u3059\u308b\u3053\u3068\u3067\u3001\u30d0\u30fc\u30b8\u30e7\u30f3\u3092\u78ba\u8a8d\u3059\u308b\u3053\u3068\u304c\u3067\u304d\u307e\u3059\u3002<\/p>\n<p><img decoding=\"async\" loading=\"lazy\" class=\"alignnone size-full wp-image-5352\" src=\"http:\/\/www.code-magagine.com\/wp-content\/uploads\/2018\/07\/npm.png\" alt=\"\" width=\"432\" height=\"110\" srcset=\"http:\/\/www.code-magagine.com\/wp-content\/uploads\/2018\/07\/npm.png 432w, http:\/\/www.code-magagine.com\/wp-content\/uploads\/2018\/07\/npm-300x76.png 300w\" sizes=\"(max-width: 432px) 100vw, 432px\" \/><\/p>\n<h2>save\u3001save-dev\u3001save-optional\u306e\u9055\u3044<\/h2>\n<p><span style=\"color: #ff0000;\"><strong>\u300cnpm install \u30d1\u30c3\u30b1\u30fc\u30b8\u540d\u300d<\/strong><\/span>\u7b49\u3067\u30d1\u30c3\u30b1\u30fc\u30b8\u306e\u30a4\u30f3\u30b9\u30c8\u30fc\u30eb\u3092\u884c\u3046\u5834\u5408\u306f\u4e0b\u8a18\u306e\u3088\u3046\u306a\u30aa\u30d7\u30b7\u30e7\u30f3\u3092\u3064\u3051\u308b\u3068\u601d\u3044\u307e\u3059\u304c\u305d\u306e\u9055\u3044\u3092\u307e\u3068\u3081\u3066\u304a\u304d\u307e\u3059\u3002<span style=\"color: #ff0000;\"><strong>\u57fa\u672c\u7684\u306b\u306f\u3001\u4ed6\u306e\u4eba\u304cnpm intall\u3092\u5b9f\u884c\u3057\u305f\u969b\u306e\u6319\u52d5\u304c\u5909\u308f\u308a\u307e\u3059\u3002<\/strong><\/span><\/p>\n<h3>save<\/h3>\n<p>package.json\u306e<span style=\"color: #ff0000;\"><strong>dependencies<\/strong><\/span>\u306b\u8a18\u8f09\u3055\u308c\u307e\u3059\u3002\u4ed6\u306e\u4eba\u304cnpm install\u30b3\u30de\u30f3\u30c9\u3092\u5b9f\u884c\u3057\u305f\u969b\u306b\u5168\u3066node_modules\u306b\u30a4\u30f3\u30b9\u30c8\u30fc\u30eb\u3055\u308c\u307e\u3059\u3002<\/p>\n<h3>save-dev<\/h3>\n<p>package.json\u306e<span style=\"color: #ff0000;\"><strong>dev<\/strong><strong>Dependencies<\/strong><\/span>\u306b\u8a18\u8f09\u3055\u308c\u307e\u3059\u3002<span style=\"color: #ff0000;\"><strong>\u4ed6\u306e\u4eba\u304cnpm intall\u3092\u5b9f\u884c\u3057\u3066\u3082\u30a4\u30f3\u30b9\u30c8\u30fc\u30eb\u3055\u308c\u306a\u3044\u306e\u3067\u958b\u767a\u6642\u306b\u81ea\u5206\u3060\u3051\u304c\u4f7f\u7528\u3057\u305f\u3044\u30d1\u30c3\u30b1\u30fc\u30b8\u7b49\u3092\u4f7f\u3046\u5834\u5408<\/strong><\/span>\u306b\u3053\u306e\u30aa\u30d7\u30b7\u30e7\u30f3\u3092\u4ed8\u3051\u307e\u3059\u3002<\/p>\n<h3>save-optional<\/h3>\n<p>package.json\u306e<span style=\"color: #ff0000;\"><strong>optional<\/strong><strong>Dependencies<\/strong><\/span>\u306b\u8a18\u8f09\u3055\u308c\u307e\u3059\u3002npm install\u3092\u5b9f\u884c\u3057\u305f\u969b\u306b\u5168\u3066\u30a4\u30f3\u30b9\u30c8\u30fc\u30eb\u3055\u308c\u307e\u3059\u3002\uff08\u305f\u3060\u3057\u30a4\u30f3\u30b9\u30c8\u30fc\u30eb\u306b\u5931\u6557\u3057\u305f\u5834\u5408\u306f\u30b9\u30eb\u30fc\u3055\u308c\u307e\u3059\u3002\uff09\u3001\u6b63\u76f4\u3042\u307e\u308a\u4f7f\u308f\u306a\u3044\u30aa\u30d7\u30b7\u30e7\u30f3\u3067\u3059\u3002<\/p>\n<h2>\u30ed\u30fc\u30ab\u30eb\u30a4\u30f3\u30b9\u30c8\u30fc\u30eb\u3068\u30b0\u30ed\u30fc\u30d0\u30eb\u30a4\u30f3\u30b9\u30c8\u30fc\u30eb\u306e\u9055\u3044<\/h2>\n<h3>\u30b0\u30ed\u30fc\u30d0\u30eb\u30a4\u30f3\u30b9\u30c8\u30fc\u30eb<\/h3>\n<p>PC\u4e0a\u306e\u3069\u306e\u30c7\u30a3\u30ec\u30af\u30c8\u30ea\u304b\u3089\u3082\u30b3\u30de\u30f3\u30c9\u304c\u5b9f\u884c\u3067\u304d\u308b\u5834\u6240\uff08path\u304c\u901a\u3063\u305f\u5834\u6240\uff09\u306b\u30a4\u30f3\u30b9\u30c8\u30fc\u30eb\u3055\u308c\u307e\u3059\u3002<span style=\"color: #ff0000;\"><strong>\u7279\u5b9a\u306e\u30d7\u30ed\u30b8\u30a7\u30af\u30c8\u3067\u306f\u306a\u304f\u3001\u30d7\u30ed\u30b8\u30a7\u30af\u30c8\u3092\u554f\u308f\u305a\u3088\u304f\u4f7f\u3046\u53ef\u80fd\u6027\u306e\u3042\u308b\u30b3\u30de\u30f3\u30c9\u3092\u30a4\u30f3\u30b9\u30c8\u30fc\u30eb<\/strong><\/span>\u3057\u307e\u3059\u3002\u57fa\u672c\u7684\u306b\u306f\u3001Docker\u306a\u3069\u3067\u30d7\u30ed\u30b8\u30a7\u30af\u30c8\u3054\u3068\u306b\u72ec\u81ea\u306b\u74b0\u5883\u69cb\u7bc9\u3059\u308b\u306e\u304c\u4e3b\u6d41\u306b\u306a\u3063\u3066\u3044\u308b\u4eca\u3001\u958b\u767a\u7528\u9014\u3067\u306f\u3042\u307e\u308a\u4f7f\u308f\u306a\u3044\u3068\u8a00\u3063\u3066\u826f\u3044\u3067\u3057\u3087\u3046\u3002\uff08\u3061\u3087\u3063\u3068\u81ea\u5206\u306ePC\u3067\u691c\u8a3c\u3092\u3059\u308b\u306a\u3069\u306e\u7528\u9014\u3067\u3057\u304b\u4f7f\u308f\u306a\u3044\u3002\uff09<\/p>\n<p>\u4ee5\u4e0b\u306e\u3088\u3046\u306b\u4f7f\u3044\u307e\u3059\u3002<\/p>\n<pre class=\"lang:default decode:true\">npm install -g xxx(\u30d1\u30c3\u30b1\u30fc\u30b8\u540d)<\/pre>\n<h3>\u30ed\u30fc\u30ab\u30eb\u30a4\u30f3\u30b9\u30c8\u30fc\u30eb<\/h3>\n<p>\u30ab\u30ec\u30f3\u30c8\u30c7\u30a3\u30ec\u30af\u30c8\u30ea\u306enode_modules\u306b\u30a4\u30f3\u30b9\u30c8\u30fc\u30eb\u3055\u308c\u307e\u3059\u3002<\/p>\n<pre class=\"lang:default decode:true \">npm install -g xxx(\u30d1\u30c3\u30b1\u30fc\u30b8\u540d)<\/pre>\n","protected":false},"excerpt":{"rendered":"Node.js\u3068\u3044\u3046\u30b5\u30fc\u30d0\u30fc\u30b5\u30a4\u30c9\u3067\u52d5\u304fJavaScript\u3092\u52d5\u4f5c\u3055\u305b\u308b\u305f\u3081\u306e\u30d1\u30c3\u30b1\u30fc\u30b8\u7ba1\u7406\u30c4\u30fc\u30eb\u306e\u3053\u3068\u3067\u3059\u3002 npm\u306e\u30e1\u30ea\u30c3\u30c8 Node.js\u306e\u958b\u767a\u8005\u306e\u4eba\u6570\u306f\u591a\u304f\u3001\u5927\u91cf\u306e\u30e9\u30a4\u30d6\u30e9\u30ea\u3084\u3001\u8cc7\u6599\u304c\u7528\u610f\u3055\u308c\u3066\u3044\u307e\u3059\u3002\u30dc\u30e9\u30f3\u30c6\u30a3 [&hellip;]","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":[],"categories":[16,62],"tags":[],"_links":{"self":[{"href":"http:\/\/www.code-magagine.com\/index.php?rest_route=\/wp\/v2\/posts\/5348"}],"collection":[{"href":"http:\/\/www.code-magagine.com\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"http:\/\/www.code-magagine.com\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"http:\/\/www.code-magagine.com\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"http:\/\/www.code-magagine.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=5348"}],"version-history":[{"count":10,"href":"http:\/\/www.code-magagine.com\/index.php?rest_route=\/wp\/v2\/posts\/5348\/revisions"}],"predecessor-version":[{"id":20308,"href":"http:\/\/www.code-magagine.com\/index.php?rest_route=\/wp\/v2\/posts\/5348\/revisions\/20308"}],"wp:attachment":[{"href":"http:\/\/www.code-magagine.com\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=5348"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"http:\/\/www.code-magagine.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=5348"},{"taxonomy":"post_tag","embeddable":true,"href":"http:\/\/www.code-magagine.com\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=5348"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}