{"id":215,"date":"2022-02-08T15:33:38","date_gmt":"2022-02-08T06:33:38","guid":{"rendered":"https:\/\/software.satoshis.jp\/?p=215"},"modified":"2022-02-08T15:33:38","modified_gmt":"2022-02-08T06:33:38","slug":"mac%e3%81%abnode-js%e3%81%a8npm%e3%82%92%e3%82%a4%e3%83%b3%e3%82%b9%e3%83%88%e3%83%bc%e3%83%ab%e3%81%99%e3%82%8b%e6%96%b9%e6%b3%95","status":"publish","type":"post","link":"https:\/\/software.satoshis.jp\/?p=215","title":{"rendered":"Mac\u306bnode.js\u3068npm\u3092\u30a4\u30f3\u30b9\u30c8\u30fc\u30eb\u3059\u308b\u65b9\u6cd5"},"content":{"rendered":"<p><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/software.satoshis.jp\/wp-content\/uploads\/2022\/02\/node-js-logo-300x183.png\" alt=\"\" width=\"300\" height=\"183\" class=\"alignnone size-medium wp-image-216\" srcset=\"https:\/\/software.satoshis.jp\/wp-content\/uploads\/2022\/02\/node-js-logo-300x183.png 300w, https:\/\/software.satoshis.jp\/wp-content\/uploads\/2022\/02\/node-js-logo.png 758w\" sizes=\"auto, (max-width: 300px) 100vw, 300px\" \/><\/p>\n<p>Homebrew\u3092\u4f7f\u3063\u3066\u30a4\u30f3\u30b9\u30c8\u30fc\u30eb\u3059\u308b\u306e\u304c\u7c21\u5358\u3067\u3059\u3002<\/p>\n<h3>Homebrew\u306e\u30a4\u30f3\u30b9\u30c8\u30fc\u30eb<\/h3>\n<p>\u307e\u3060Homebrew\u3092\u30a4\u30f3\u30b9\u30c8\u30fc\u30eb\u3057\u3066\u306a\u3044\u306e\u306a\u3089\u3001\u307e\u305aHomebrew\u3092\u30a4\u30f3\u30b9\u30c8\u30fc\u30eb\u3057\u307e\u3057\u3087\u3046\u3002<\/p>\n<p>\u30b7\u30a7\u30eb\u3067\u4ee5\u4e0b\u306e\u30b3\u30de\u30f3\u30c9\u3092\u5b9f\u884c\u3057\u307e\u3059\u3002<\/p>\n<pre class=\"brush: bash; title: ; notranslate\" title=\"\">\r\n% \/usr\/bin\/ruby -e &quot;$(curl -fsSL https:\/\/raw.githubusercontent.com\/Homebrew\/install\/master\/install)&quot;\r\n<\/pre>\n<p>\u30a4\u30f3\u30b9\u30c8\u30fc\u30eb\u306b\u6210\u529f\u3059\u308c\u3070\u3001help\u3057\u3066\u307f\u308b\u3068\u308f\u304b\u308a\u307e\u3059\u3002<\/p>\n<pre class=\"brush: bash; title: ; notranslate\" title=\"\">\r\n% brew --help\r\nExample usage:\r\n  brew search TEXT|\/REGEX\/\r\n  brew info &#x5B;FORMULA|CASK...]\r\n  brew install FORMULA|CASK...\r\n  brew update\r\n  brew upgrade &#x5B;FORMULA|CASK...]\r\n  brew uninstall FORMULA|CASK...\r\n  brew list &#x5B;FORMULA|CASK...]\r\n\r\nTroubleshooting:\r\n  brew config\r\n  brew doctor\r\n  brew install --verbose --debug FORMULA|CASK\r\n\r\nContributing:\r\n  brew create URL &#x5B;--no-fetch]\r\n  brew edit &#x5B;FORMULA|CASK...]\r\n\r\nFurther help:\r\n  brew commands\r\n  brew help &#x5B;COMMAND]\r\n  man brew\r\n  https:\/\/docs.brew.sh\r\n<\/pre>\n<h3>nodebrew\u306e\u30a4\u30f3\u30b9\u30c8\u30fc\u30eb<\/h3>\n<p>nodebrew\u3092\u30a4\u30f3\u30b9\u30c8\u30fc\u30eb\u3057\u307e\u3059\u3002<\/p>\n<pre class=\"brush: bash; title: ; notranslate\" title=\"\">\r\n% brew install nodebrew\r\nRunning `brew update --preinstall`...\r\n==&gt; Auto-updated Homebrew!\r\nUpdated 2 taps (homebrew\/core and homebrew\/cask).\r\n==&gt; New Formulae\r\nalpscore                                                           ruby@3.0\r\n==&gt; Updated Formulae\r\nUpdated 47 formulae.\r\n==&gt; Updated Casks\r\nUpdated 48 casks.\r\n\r\n==&gt; Downloading https:\/\/ghcr.io\/v2\/homebrew\/core\/nodebrew\/manifests\/1.1.0-1\r\n######################################################################## 100.0%\r\n==&gt; Downloading https:\/\/ghcr.io\/v2\/homebrew\/core\/nodebrew\/blobs\/sha256:f9e68ad3b92827534fc9faf5d7b9c4d1fe61e4e1fa11a99e03c6cc476593fe\r\n==&gt; Downloading from https:\/\/pkg-containers.githubusercontent.com\/ghcr1\/blobs\/sha256:f9e68ad3b92827534fc9faf5d7b9c4d1fe61e4e1fa11a99e\r\n######################################################################## 100.0%\r\n==&gt; Pouring nodebrew--1.1.0.all.bottle.1.tar.gz\r\n==&gt; Caveats\r\nYou need to manually run setup_dirs to create directories required by nodebrew:\r\n  \/usr\/local\/opt\/nodebrew\/bin\/nodebrew setup_dirs\r\n\r\nAdd path:\r\n  export PATH=$HOME\/.nodebrew\/current\/bin:$PATH\r\n\r\nTo use Homebrew's directories rather than ~\/.nodebrew add to your profile:\r\n  export NODEBREW_ROOT=\/usr\/local\/var\/nodebrew\r\n\r\nzsh completions have been installed to:\r\n  \/usr\/local\/share\/zsh\/site-functions\r\n==&gt; Summary\r\n\ud83c\udf7a  \/usr\/local\/Cellar\/nodebrew\/1.1.0: 8 files, 39KB\r\n==&gt; Running `brew cleanup nodebrew`...\r\nDisable this behaviour by setting HOMEBREW_NO_INSTALL_CLEANUP.\r\nHide these hints with HOMEBREW_NO_ENV_HINTS (see `man brew`).\r\n<\/pre>\n<p>PATH\u3068NODEBREW_ROOT\u306e\u74b0\u5883\u5909\u6570\u3092\u8a2d\u5b9a\u3059\u308b\u3088\u3046\u306b\u30e1\u30c3\u30bb\u30fc\u30b8\u304c\u51fa\u3066\u307e\u3059\u306e\u3067\u3001\u305d\u306e\u3088\u3046\u306b\u8a2d\u5b9a\u3057\u307e\u3059\u3002<br \/>\nvi \u3067 .zshrc \u3092\u958b\u304d\u3001PATH\u306b\u4e0a\u8a18\u306e\u30d1\u30b9\u3092\u8ffd\u52a0\u3057\u3001\u65b0\u305f\u306bNODEBREW_ROOT\u3092\u8ffd\u52a0\u3057\u307e\u3059\u3002<\/p>\n<pre class=\"brush: plain; title: ; notranslate\" title=\"\">\r\nexport PATH=$HOME\/.nodebrew\/current\/bin:$HOME\/bin:(\u7565)\r\nexport NODEBREW_ROOT=\/usr\/local\/var\/nodebrew\r\n<\/pre>\n<p>\u65b0\u3057\u3044\u8a2d\u5b9a\u3092\u8aad\u307f\u8fbc\u307f\u307e\u3059\u3002<\/p>\n<pre class=\"brush: bash; title: ; notranslate\" title=\"\">\r\n% source .zshrc\r\n<\/pre>\n<p>\u30d1\u30b9\u3092\u901a\u3057\u305f\u306e\u3067\u30b3\u30de\u30f3\u30c9\u304c\u5b9f\u884c\u3067\u304d\u307e\u3059\u3002<\/p>\n<pre class=\"brush: bash; title: ; notranslate\" title=\"\">\r\n% nodebrew -v\r\nnodebrew 1.1.0\r\n\r\nUsage:\r\n    nodebrew help                         Show this message\r\n    nodebrew install &lt;version&gt;            Download and install &lt;version&gt; (from binary)\r\n    nodebrew compile &lt;version&gt;            Download and install &lt;version&gt; (from source)\r\n    nodebrew install-binary &lt;version&gt;     Alias of `install` (For backward compatibility)\r\n    nodebrew uninstall &lt;version&gt;          Uninstall &lt;version&gt;\r\n    nodebrew use &lt;version&gt;                Use &lt;version&gt;\r\n    nodebrew list                         List installed versions\r\n    nodebrew ls                           Alias for `list`\r\n    nodebrew ls-remote                    List remote versions\r\n    nodebrew ls-all                       List remote and installed versions\r\n    nodebrew alias &lt;key&gt; &lt;value&gt;          Set alias\r\n    nodebrew unalias &lt;key&gt;                Remove alias\r\n    nodebrew clean &lt;version&gt; | all        Remove source file\r\n    nodebrew selfupdate                   Update nodebrew\r\n    nodebrew migrate-package &lt;version&gt;    Install global NPM packages contained in &lt;version&gt; to current version\r\n    nodebrew exec &lt;version&gt; -- &lt;command&gt;  Execute &lt;command&gt; using specified &lt;version&gt;\r\n\r\nExample:\r\n    # install\r\n    nodebrew install v8.9.4\r\n\r\n    # use a specific version number\r\n    nodebrew use v8.9.4\r\n<\/pre>\n<h3>node.js\u306e\u30a4\u30f3\u30b9\u30c8\u30fc\u30eb<\/h3>\n<p>nodebrew \u306e\u30a4\u30f3\u30b9\u30c8\u30fc\u30eb\u304c\u3067\u304d\u305f\u306e\u3067\u3001\u6b21\u306f node.js \u3092\u30a4\u30f3\u30b9\u30c8\u30fc\u30eb\u3057\u307e\u3059\u3002<\/p>\n<p>latest \u3092\u6307\u5b9a\u3059\u308c\u3070\u3001\u6700\u65b0\u7248\u3092\u30a4\u30f3\u30b9\u30c8\u30fc\u30eb\u3067\u304d\u307e\u3059\u3002<\/p>\n<pre class=\"brush: bash; title: ; notranslate\" title=\"\">\r\n % nodebrew install-binary latest\r\nFetching: https:\/\/nodejs.org\/dist\/v17.4.0\/node-v17.4.0-darwin-x64.tar.gz\r\nWarning: Failed to create the file\r\nWarning: \/usr\/local\/var\/nodebrew\/src\/v17.4.0\/node-v17.4.0-darwin-x64.tar.gz:\r\nWarning: No such file or directory\r\ncurl: (23) Failure writing output to destination\r\n\r\ndownload failed: https:\/\/nodejs.org\/dist\/v17.4.0\/node-v17.4.0-darwin-x64.tar.gz\r\n<\/pre>\n<p>\u30a8\u30e9\u30fc\u306b\u306a\u3063\u3066\u3057\u307e\u3044\u307e\u3057\u305f\u3002<br \/>\n\u30d5\u30a1\u30a4\u30eb\u3092\u4f5c\u308b\u306e\u306b\u5931\u6557\u3057\u3066\u308b\u3088\u3046\u3067\u3059\u3002<\/p>\n<pre class=\"brush: bash; title: ; notranslate\" title=\"\">\r\n% ls \/usr\/local\/var\/\r\ncache\t\thomebrew\tlog\t\trun\r\n<\/pre>\n<p>\/usr\/local\/var \u306b nodebrew \u30c7\u30a3\u30ec\u30af\u30c8\u30ea\u304c\u306a\u3044\u304b\u3089\uff1f<\/p>\n<p>\u3068\u3044\u3046\u304b\u3001\u305d\u3053\u306b\u5165\u308c\u308b\u3093\u3060\u3063\u305f\u3089 sudo \u3057\u306a\u3044\u3068\u3044\u3051\u306a\u3044\u3088\u3046\u306a\u3002<\/p>\n<pre class=\"brush: bash; title: ; notranslate\" title=\"\">\r\n% sudo nodebrew install-binary latest\r\nPassword:\r\nFetching: https:\/\/nodejs.org\/dist\/v17.4.0\/node-v17.4.0-darwin-x64.tar.gz\r\nWarning: Failed to create the file\r\nWarning: \/Users\/satoshis\/.nodebrew\/src\/v17.4.0\/node-v17.4.0-darwin-x64.tar.gz:\r\nWarning: No such file or directory\r\ncurl: (23) Failure writing output to destination\r\n\r\ndownload failed: https:\/\/nodejs.org\/dist\/v17.4.0\/node-v17.4.0-darwin-x64.tar.gz\r\n<\/pre>\n<p>sudo \u3067\u3084\u3063\u3066\u307f\u308b\u3068\u4fdd\u5b58\u5148\u304c\u5909\u308f\u3063\u3066\u307e\u3059\u3002<\/p>\n<p>\u3068\u308a\u3042\u3048\u305a\u3001\u81ea\u5206\u7528\u306e\u30db\u30fc\u30e0\u306b\u30c7\u30a3\u30ec\u30af\u30c8\u30ea\u3092\u4f5c\u308a\u307e\u3059\u3002<\/p>\n<pre class=\"brush: bash; title: ; notranslate\" title=\"\">\r\n% mkdir -p ~\/.nodebrew\/src\r\n<\/pre>\n<p>\u3082\u3046\u4e00\u5ea6\u3001sudo \u3067\u3084\u3063\u3066\u307f\u307e\u3059\u3002<\/p>\n<pre class=\"brush: bash; title: ; notranslate\" title=\"\">\r\n % sudo nodebrew install-binary latest\r\nFetching: https:\/\/nodejs.org\/dist\/v17.4.0\/node-v17.4.0-darwin-x64.tar.gz\r\n############################################################################################################################## 100.0%\r\nInstalled successfully\r\n<\/pre>\n<p>\u3046\u307e\u304f\u3044\u304d\u307e\u3057\u305f\u3002<br \/>\n\u3069\u306e\u30d0\u30fc\u30b8\u30e7\u30f3\u304c\u30a4\u30f3\u30b9\u30c8\u30fc\u30eb\u3055\u308c\u305f\u306e\u304b\u78ba\u8a8d\u3057\u3066\u307f\u307e\u3059\u3002<\/p>\n<pre class=\"brush: bash; title: ; notranslate\" title=\"\">\r\n% nodebrew ls\r\nNo such file or directory at \/usr\/local\/bin\/nodebrew line 575.\r\n<\/pre>\n<p>\u3042\u3089\u3089\uff1f<br \/>\n\u30a8\u30e9\u30fc\u30e1\u30c3\u30bb\u30fc\u30b8\u3067\u3050\u3050\u3063\u3066\u307f\u307e\u3057\u305f\u3002<\/p>\n<p>\u226b <a href=\"https:\/\/qiita.com\/limonene\/items\/a10c2755dd2784357c43\" target=\"_blank\" rel=\"noopener\"> Homebrew\u304b\u3089nodebrew\u3092\u30a4\u30f3\u30b9\u30c8\u30fc\u30eb\u3057\u3066\u3001Node.js\u3092\u30a4\u30f3\u30b9\u30c8\u30fc\u30eb\u3059\u308b\u307e\u3067 &#8211; Qiita<\/a><\/p>\n<p>setup\u3059\u308c\u3070\u3044\u3044\u307f\u305f\u3044\u3067\u3059\u3002<\/p>\n<pre class=\"brush: bash; title: ; notranslate\" title=\"\">\r\n% nodebrew setup\r\nFetching nodebrew...\r\nInstalled nodebrew in \/usr\/local\/var\/nodebrew\r\n\r\n========================================\r\nExport a path to nodebrew:\r\n\r\nexport PATH=\/usr\/local\/var\/nodebrew\/current\/bin:$PATH\r\n========================================\r\n<\/pre>\n<p>PATH\u3092\u8ffd\u52a0\u3057\u308d\u3068\u8a00\u3063\u3066\u308b\u306e\u3067\u3001\u8ffd\u52a0\u3057\u307e\u3057\u3087\u3046\u3002<br \/>\n.zshrc \u3092\u7de8\u96c6\u3057\u307e\u3059\u3002<\/p>\n<pre class=\"brush: plain; title: ; notranslate\" title=\"\">\r\nexport PATH=&quot;\/usr\/local\/var\/nodebrew\/current\/bin:$HOME\/.nodebrew\/current\/bin:(\u7565)\r\n<\/pre>\n<p>\u3082\u3046\u4e00\u5ea6\u3001\u30d0\u30fc\u30b8\u30e7\u30f3\u78ba\u8a8d\u3057\u3066\u307f\u308b\u3068\u3002<\/p>\n<pre class=\"brush: bash; title: ; notranslate\" title=\"\">\r\nnodebrew ls\r\nnot installed\r\n\r\ncurrent: none\r\n<\/pre>\n<p>\u30a4\u30f3\u30b9\u30c8\u30fc\u30eb\u3067\u304d\u3066\u306a\u3044\u3067\u3059\u306d\u3002<br \/>\n\u3082\u3046\u4e00\u5ea6\u3001\u30a4\u30f3\u30b9\u30c8\u30fc\u30eb\u3057\u3066\u307f\u307e\u3059\u3002<\/p>\n<pre class=\"brush: bash; title: ; notranslate\" title=\"\">\r\n% nodebrew install-binary latest\r\nFetching: https:\/\/nodejs.org\/dist\/v17.4.0\/node-v17.4.0-darwin-x64.tar.gz\r\n############################################################################################################################## 100.0%\r\nInstalled successfully\r\n<\/pre>\n<p>\u305d\u3057\u3066\u3001\u30d0\u30fc\u30b8\u30e7\u30f3\u78ba\u8a8d\u3057\u3066\u307f\u308b\u3068\u3002<\/p>\n<pre class=\"brush: bash; title: ; notranslate\" title=\"\">\r\n% nodebrew ls\r\nv17.4.0\r\n\r\ncurrent: none\r\n<\/pre>\n<p>\u30a4\u30f3\u30b9\u30c8\u30fc\u30eb\u3067\u304d\u305f\u30d0\u30fc\u30b8\u30e7\u30f3\u3092\u6709\u52b9\u5316\u3057\u3001\u3055\u3089\u306b\u30d0\u30fc\u30b8\u30e7\u30f3\u78ba\u8a8d\u3082\u3084\u308a\u307e\u3059\u3002<\/p>\n<pre class=\"brush: bash; title: ; notranslate\" title=\"\">\r\n% nodebrew use v17.4.0\r\nuse v17.4.0\r\n% nodebrew ls\r\nv17.4.0\r\n\r\ncurrent: v17.4.0\r\n<\/pre>\n<p>current \u304c\u8a2d\u5b9a\u3055\u308c\u307e\u3057\u305f\u3002<\/p>\n<p>\u30d0\u30fc\u30b8\u30e7\u30f3\u78ba\u8a8d\u3057\u3066\u307f\u307e\u3059\u3002<\/p>\n<pre class=\"brush: bash; title: ; notranslate\" title=\"\">\r\n% node -v\r\nv17.4.0\r\n<\/pre>\n<p>node.js \u304c\u52d5\u304f\u3088\u3046\u306b\u306a\u308a\u307e\u3057\u305f\u3002<\/p>\n<p>npm \u3082\u78ba\u8a8d\u3057\u3066\u307f\u307e\u3059\u3002<\/p>\n<pre class=\"brush: bash; title: ; notranslate\" title=\"\">\r\n% npm -v\r\n8.3.1\r\n<\/pre>\n<p>\u3053\u308c\u3067\u30a4\u30f3\u30b9\u30c8\u30fc\u30eb\u5b8c\u4e86\u3067\u3059\u306d\uff01<\/p>\n","protected":false},"excerpt":{"rendered":"<p>Homebrew\u3092\u4f7f\u3063\u3066\u30a4\u30f3\u30b9\u30c8\u30fc\u30eb\u3059\u308b\u306e\u304c\u7c21\u5358\u3067\u3059\u3002 Homebrew\u306e\u30a4\u30f3\u30b9\u30c8\u30fc\u30eb \u307e\u3060Homebrew\u3092\u30a4\u30f3\u30b9\u30c8\u30fc\u30eb\u3057\u3066\u306a\u3044\u306e\u306a\u3089\u3001\u307e\u305aHomebrew\u3092\u30a4\u30f3\u30b9\u30c8\u30fc\u30eb\u3057\u307e\u3057\u3087\u3046\u3002 \u30b7\u30a7\u30eb\u3067\u4ee5\u4e0b\u306e &#8230; <\/p>\n","protected":false},"author":1,"featured_media":216,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[77],"tags":[80,25,78,81,79],"class_list":["post-215","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-node-js","tag-homebrew","tag-mac","tag-node-js","tag-nodebrew","tag-npm"],"nelio_content":{"autoShareEndMode":"never","automationSources":{"useCustomSentences":false,"customSentences":[]},"efiAlt":"","efiUrl":"","followers":[1],"highlights":[],"isAutoShareEnabled":true,"networkImageIds":[],"permalinkQueryArgs":[],"series":[],"suggestedReferences":[]},"views":801,"_links":{"self":[{"href":"https:\/\/software.satoshis.jp\/index.php?rest_route=\/wp\/v2\/posts\/215","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/software.satoshis.jp\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/software.satoshis.jp\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/software.satoshis.jp\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/software.satoshis.jp\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=215"}],"version-history":[{"count":1,"href":"https:\/\/software.satoshis.jp\/index.php?rest_route=\/wp\/v2\/posts\/215\/revisions"}],"predecessor-version":[{"id":217,"href":"https:\/\/software.satoshis.jp\/index.php?rest_route=\/wp\/v2\/posts\/215\/revisions\/217"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/software.satoshis.jp\/index.php?rest_route=\/wp\/v2\/media\/216"}],"wp:attachment":[{"href":"https:\/\/software.satoshis.jp\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=215"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/software.satoshis.jp\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=215"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/software.satoshis.jp\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=215"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}