{"id":1698,"date":"2021-08-30T21:51:18","date_gmt":"2021-08-30T12:51:18","guid":{"rendered":"http:\/\/www.agile-software.site\/?p=1698"},"modified":"2021-09-05T14:49:06","modified_gmt":"2021-09-05T05:49:06","slug":"npm%e3%82%b3%e3%83%9e%e3%83%b3%e3%83%89%e3%82%92%e5%ae%9f%e8%a1%8c%e3%81%97%e3%81%a6%e3%82%a8%e3%83%a9%e3%83%bcpermission-denied%e3%81%8c%e5%87%ba%e3%81%9f%e6%99%82%e3%81%ae%e5%af%be%e5%87%a6","status":"publish","type":"post","link":"https:\/\/agile-software.net\/?p=1698","title":{"rendered":"\u30a8\u30e9\u30fc\u96c61\u3000npm\u30b3\u30de\u30f3\u30c9\u3092\u5b9f\u884c\u3057\u3066\u30a8\u30e9\u30fc(permission denied)\u304c\u51fa\u305f\u6642\u306e\u5bfe\u51e6\u6cd5"},"content":{"rendered":"\n<div class=\"hcb_wrap\"><pre class=\"prism line-numbers lang-plain\"><code><\/code><\/pre><\/div>\n\n\n\n<div class=\"hcb_wrap\"><pre class=\"prism line-numbers lang-plain\"><code>npm ERR! code EACCES\nnpm ERR! syscall access\nnpm ERR! path \/usr\/local\/lib\/node_modules\/npm\/node_modules\/abbrev\nnpm ERR! errno -13\nnpm ERR! Error: EACCES: permission denied, access &#39;\/usr\/local\/lib\/node_modules\/npm\/node_modules\/abbrev&#39;\nnpm ERR!  [Error: EACCES: permission denied, access &#39;\/usr\/local\/lib\/node_modules\/npm\/node_modules\/abbrev&#39;] {\nnpm ERR!   errno: -13,\nnpm ERR!   code: &#39;EACCES&#39;,\nnpm ERR!   syscall: &#39;access&#39;,\nnpm ERR!   path: &#39;\/usr\/local\/lib\/node_modules\/npm\/node_modules\/abbrev&#39;\nnpm ERR! }\nnpm ERR! \nnpm ERR! The operation was rejected by your operating system.\nnpm ERR! It is likely you do not have the permissions to access this file as the current user\nnpm ERR! \nnpm ERR! If you believe this might be a permissions issue, please double-check the\nnpm ERR! permissions of the file and its containing directories, or try running\nnpm ERR! the command again as root\/Administrator.\n\nnpm ERR! A complete log of this run can be found in:\nnpm ERR!     \/home\/********\/.npm\/_logs\/2021-08-30T12_40_57_778Z-debug.log<\/code><\/pre><\/div>\n\n\n\n<p><strong>\u307e\u305a\u4ee5\u4e0b\u306e\u30b3\u30de\u30f3\u30c9\u3067\u3001config\u306e\u8a2d\u5b9a\u3092\u78ba\u8a8d\u3057\u3066\u304f\u3060\u3055\u3044\u3002<\/strong>Shell<\/p>\n\n\n\n<figure class=\"wp-block-table\"><table><tbody><tr><td>1<\/td><td>npm config get prefix<\/td><\/tr><\/tbody><\/table><\/figure>\n\n\n\n<p><strong>\u60f3\u5b9a\u3059\u308b\u7d50\u679c\u753b\u9762<\/strong>Shell<\/p>\n\n\n\n<figure class=\"wp-block-table\"><table><tbody><tr><td>1<\/td><td>\/usr\/local<\/td><\/tr><\/tbody><\/table><\/figure>\n\n\n\n<p>\u3082\u3057\u3082\u300c\/usr\/local\u300d\u3067\u306f\u306a\u3044\u5834\u5408\u306f\u3001\u4ee5\u4e0b\u306e\u30b5\u30a4\u30c8\u306e\u300c\u5bfe\u7b562\u300d\u307e\u305f\u306f\u3001\u300c\u5bfe\u7b563\u300d\u3092\u53c2\u7167\u3057\u3066\u307f\u3066\u304f\u3060\u3055\u3044\u3002<\/p>\n\n\n\n<p><a href=\"https:\/\/qiita.com\/okohs\/items\/ced3c3de30af1035242d\" rel=\"noreferrer noopener\" target=\"_blank\">Qiita: npm\u3067permission denied\u306b\u306a\u3063\u305f\u6642\u306e\u5bfe\u51e6\u6cd5[mac]<\/a><\/p>\n\n\n\n<p><strong>\u81ea\u5206\u3092\u30aa\u30fc\u30ca\u30fc\u306b\u3059\u308b\u30b3\u30de\u30f3\u30c9\u3092\u5b9f\u884c\u3057\u307e\u3059\u3002PC\u306e\u30d1\u30b9\u30ef\u30fc\u30c9\u3092\u805e\u304b\u308c\u308b\u306e\u3067\u5165\u529b\u3057\u307e\u3057\u3087\u3046\u3002<\/strong>Shell<\/p>\n\n\n\n<figure class=\"wp-block-table\"><table><tbody><tr><td>1<\/td><td>sudo chown -R $(whoami) $(npm config get prefix)\/{lib\/node_modules,bin,share}<\/td><\/tr><\/tbody><\/table><\/figure>\n\n\n\n<p>chown\u306b-R\u30aa\u30d7\u30b7\u30e7\u30f3\u304c\u3064\u3044\u3066\u3044\u308b\u306e\u3067\u3001\u3053\u306e\u30c7\u30a3\u30ec\u30af\u30c8\u30ea\u4ee5\u4e0b\u306e\u6a29\u9650\u304c\u5168\u3066\u5909\u66f4\u3055\u308c\u307e\u3059\u3002<\/p>\n","protected":false},"excerpt":{"rendered":"<p>\u307e\u305a\u4ee5\u4e0b\u306e\u30b3\u30de\u30f3\u30c9\u3067\u3001config\u306e\u8a2d\u5b9a\u3092\u78ba\u8a8d\u3057\u3066\u304f\u3060\u3055\u3044\u3002Shell 1 npm config get prefix \u60f3\u5b9a\u3059\u308b\u7d50\u679c\u753b\u9762Shell 1 \/usr\/local \u3082\u3057\u3082\u300c\/usr\/local\u300d\u3067\u306f\u306a\u3044\u5834\u5408\u306f\u3001<\/p>\n","protected":false},"author":1,"featured_media":1714,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"_jin_ogp_image_url":"","_jin_last_featured_id":0,"footnotes":""},"categories":[10],"tags":[],"class_list":["post-1698","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-10"],"_links":{"self":[{"href":"https:\/\/agile-software.net\/index.php?rest_route=\/wp\/v2\/posts\/1698","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/agile-software.net\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/agile-software.net\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/agile-software.net\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/agile-software.net\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=1698"}],"version-history":[{"count":4,"href":"https:\/\/agile-software.net\/index.php?rest_route=\/wp\/v2\/posts\/1698\/revisions"}],"predecessor-version":[{"id":1712,"href":"https:\/\/agile-software.net\/index.php?rest_route=\/wp\/v2\/posts\/1698\/revisions\/1712"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/agile-software.net\/index.php?rest_route=\/wp\/v2\/media\/1714"}],"wp:attachment":[{"href":"https:\/\/agile-software.net\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=1698"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/agile-software.net\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=1698"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/agile-software.net\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=1698"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}