{"id":154,"date":"2012-01-05T22:02:29","date_gmt":"2012-01-06T06:02:29","guid":{"rendered":"http:\/\/h2plus.biz\/hiromitsu\/?p=154"},"modified":"2012-01-13T16:17:38","modified_gmt":"2012-01-14T00:17:38","slug":"nvm%e3%81%a7node-js%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","status":"publish","type":"post","link":"https:\/\/h2plus.biz\/hiromitsu\/entry\/154","title":{"rendered":"nvm\u3067node.js\u3092\u30a4\u30f3\u30b9\u30c8\u30fc\u30eb\u3059\u308b"},"content":{"rendered":"<p>node.js\u306f\u30bd\u30fc\u30b9\u30b3\u30fc\u30c9\u306b\u52a0\u3048\u3066\u3001Windows\u7248\u3001Mac\u7248\u306e\u30a4\u30f3\u30b9\u30c8\u30fc\u30e9\u304c\u7528\u610f\u3055\u308c\u3066\u3044\u308b\u304c\u3001\u306a\u306b\u305bnode.js\u306f\u4eca\u306e\u306a\u304a\u958b\u767a\u9032\u884c\u5f62\u3067\u983b\u7e41\u306b\u30d0\u30fc\u30b8\u30e7\u30f3\u30a2\u30c3\u30d7\u304c\u3055\u308c\u3066\u304a\u308a\u3001\u305d\u306e\u90fd\u5ea6\u30a2\u30f3\u30a4\u30f3\u30b9\u30c8\u30fc\u30eb\uff0f\u518d\u30a4\u30f3\u30b9\u30c8\u30fc\u30eb\u3059\u308b\u306e\u306f\u975e\u5e38\u306b\u9762\u5012\u3060\u3002node.js\u306fRuby\u306e\u5f71\u97ff\u3092\u5f37\u304f\u53d7\u3051\u3066\u3044\u308b\u306e\u304b\u3001RVM\uff08Ruby Version Manager\uff09\u3068\u540c\u3058\u3088\u3046\u306aNVM\uff08Node Version Manager\uff09\u3068\u3044\u3046\u30d0\u30fc\u30b8\u30e7\u30f3\u7ba1\u7406\u30b7\u30b9\u30c6\u30e0\u304c\u7528\u610f\u3055\u308c\u3066\u3044\u308b\u3002\u958b\u767a\u74b0\u5883\u3068\u3057\u3066\u306fNVM\u3092\u5229\u7528\u3057\u3066node.js\u3092\u81ea\u52d5\u30a4\u30f3\u30b9\u30c8\u30fc\u30eb\u3059\u308b\u65b9\u304c\u4fbf\u5229\u3060\u3002<\/p>\n<p><!--more--><br \/>\n\u3082\u3057\u65e2\u306bnode.js\u306e\u3044\u305a\u308c\u304b\u306e\u30d0\u30fc\u30b8\u30e7\u30f3\u3092\u30a4\u30f3\u30b9\u30c8\u30fc\u30eb\u6e08\u307f\u306e\u5834\u5408\u306f\u3001\u5148\u306b\u624b\u52d5\u3067\u30a2\u30f3\u30a4\u30f3\u30b9\u30c8\u30fc\u30eb\u3057\u3066\u304a\u3053\u3046\u3002\u30bd\u30fc\u30b9\u304b\u3089\u30d3\u30eb\u30c9\u3057\u3066\u30a4\u30f3\u30b9\u30c8\u30fc\u30eb\u3057\u305f\u5834\u5408\u3001prefix\u304c\u30c7\u30d5\u30a9\u30eb\u30c8\u3067<code>\/usr\/local<\/code>\u306b\u306a\u3063\u3066\u3044\u308b\u306e\u3067\u3001\u4ee5\u4e0b\u306e\u30b3\u30de\u30f3\u30c9\u3067node.js\u306e\u69cb\u6210\u30d5\u30a1\u30a4\u30eb\u3092\u524a\u9664\u3057\u3066\u304a\u304f\u3002<\/p>\n<pre>\r\n$ cd \/usr\/local\r\n$ sudo rm -rf {bin,lib,include}\/node share\/man\/man1\/node.1\r\n<\/pre>\n<p>nvm\u306e\u30a4\u30f3\u30b9\u30c8\u30fc\u30eb\u3068\u8a00\u3063\u3066\u3082GitHub\u304b\u3089\u30c1\u30a7\u30c3\u30af\u30a2\u30a6\u30c8\u3059\u308b\u3060\u3051\u3002\u30db\u30fc\u30e0\u30c7\u30a3\u30ec\u30af\u30c8\u30ea\u914d\u4e0b\u306e.nvm\u30c7\u30a3\u30ec\u30af\u30c8\u30ea\u306bnode.js\u306e\u74b0\u5883\u8a2d\u5b9a\u306b\u5fc5\u8981\u306a\u30d5\u30a1\u30a4\u30eb\u7fa4\u3092\u7f6e\u3044\u3066\u3044\u304f\u3053\u3068\u306b\u3059\u308b\u3002<\/p>\n<pre>\r\n$ cd ~\r\n$ git clone git:\/\/github.com\/creationix\/nvm.git .nvm\r\n$ . .nvm\/nvm.sh\r\n<\/pre>\n<p><code>nvm<\/code>\u30b3\u30de\u30f3\u30c9\u3092\u4f7f\u3046\u3068node.js\u3092\u81ea\u52d5\u3067\u30a4\u30f3\u30b9\u30c8\u30fc\u30eb\u3067\u304d\u308b\u3088\u3046\u306b\u306a\u308b\u3002\u672c\u30a8\u30f3\u30c8\u30ea\u57f7\u7b46\u6642\u70b9\u3067\u6700\u65b0\u30d0\u30fc\u30b8\u30e7\u30f3\u306ev0.6.6\u3092\u30a4\u30f3\u30b9\u30c8\u30fc\u30eb\u3057\u3066\u307f\u308b\uff08\u516c\u958b\u3055\u308c\u3066\u3044\u308b\u30d0\u30fc\u30b8\u30e7\u30f3\u306e\u4e00\u89a7\u306f<a href=\"http:\/\/nodejs.org\/dist\/\">nodejs.org\/dist<\/a>\u3092\u53c2\u7167\uff09\u3002<\/p>\n<pre>\r\n$ nvm install v0.6.6\r\n######################################################################## 100.0%\r\nChecking for program g++ or c++          : <span style=\"color:green\">\/usr\/bin\/g++<\/span> \r\nChecking for program cpp                 : <span style=\"color:green\">\/usr\/bin\/cpp<\/span> \r\nChecking for program ar                  : <span style=\"color:green\">\/usr\/bin\/ar<\/span> \r\nChecking for program ranlib              : <span style=\"color:green\">\/usr\/bin\/ranlib<\/span> \r\nChecking for g++                         : <span style=\"color:green\">ok<\/span>  \r\nChecking for program gcc or cc           : <span style=\"color:green\">\/usr\/bin\/gcc<\/span> \r\nChecking for gcc                         : <span style=\"color:green\">ok<\/span>  \r\nChecking for library dl                  : <span style=\"color:#CC0\">not found<\/span> \r\nChecking for openssl                     : <span style=\"color:#CC0\">not found<\/span> \r\nChecking for function SSL_library_init   : <span style=\"color:#CC0\">not found<\/span> \r\nChecking for header openssl\/crypto.h     : <span style=\"color:#CC0\">not found<\/span> \r\n<span style=\"color:red\">\/home\/hfujita\/.nvm\/src\/node-v0.6.6\/wscript:374: error: Could not autodetect OpenSSL support. Make sure OpenSSL development packages are installed. Use configure --without-ssl to disable this message.<\/span>\r\nnvm: install v0.6.6 failed!\r\n<\/pre>\n<p>OpenSSL\u306e\u958b\u767a\u7528\u30d1\u30c3\u30b1\u30fc\u30b8\u304c\u5fc5\u8981\u3089\u3057\u3044\u306e\u3067yum\u3067\u30a4\u30f3\u30b9\u30c8\u30fc\u30eb\u3057\u3066\u304b\u3089\u3001\u518d\u5ea6<code>nvm<\/code>\u30b3\u30de\u30f3\u30c9\u3092\u5b9f\u884c\u3057\u3066\u307f\u308b\u3002<\/p>\n<pre>\r\n$ sudo yum -y install openssl-devel\r\n$ nvm install v0.6.6\r\n<\/pre>\n<p>\u30bd\u30fc\u30b9\u306e\u30c0\u30a6\u30f3\u30ed\u30fc\u30c9\u3001\u30d3\u30eb\u30c9\u3001\u30a4\u30f3\u30b9\u30c8\u30fc\u30eb\u304c\u884c\u308f\u308c\u308b\u306e\u3067\u5b8c\u4e86\u3059\u308b\u307e\u3067\u6c17\u9577\u306b\u5f85\u3064\u3002\u30a4\u30f3\u30b9\u30c8\u30fc\u30eb\u304c\u5b8c\u4e86\u3057\u305f\u3089node\u306e\u30d0\u30fc\u30b8\u30e7\u30f3\u3092\u78ba\u8a8d\u3002nvm\u3092\u4f7f\u3046\u3068npm\u306e\u6700\u65b0\u30d0\u30fc\u30b8\u30e7\u30f3\u3082\u4e00\u7dd2\u306b\u30a4\u30f3\u30b9\u30c8\u30fc\u30eb\u3055\u308c\u308b\u3002<\/p>\n<pre>\r\n$ node -v\r\nv0.6.6\r\n$ npm -v\r\n1.1.0-beta-4\r\n<\/pre>\n<p>\u81ea\u5206\u306e\u30b7\u30a7\u30eb\u74b0\u5883\u3067nvm\u30b3\u30de\u30f3\u30c9\u304c\u4f7f\u3048\u308b\u3088\u3046\u306b\u3001<code>~\/.bashrc<\/code>\uff08\u3082\u3057\u304f\u306f<code>~\/.bash_profile<\/code>\uff09\u306b\u4ee5\u4e0b\u306e\u30b9\u30af\u30ea\u30d7\u30c8\u3092\u8ffd\u52a0\u3057\u3066\u304a\u304f\u3002<\/p>\n<pre class=\"brush: bash; title: ; notranslate\" title=\"\">\r\nif [ &quot;$TERM&quot; = &quot;xterm&quot; ]; then\r\n    # Enable nvm (Node Version Manager)\r\n    if [ -s ~\/.nvm\/nvm.sh ]; then\r\n        . ~\/.nvm\/nvm.sh\r\n        nvm alias default 0.6 &gt; \/dev\/null\r\n    fi\r\nfi\r\n<\/pre>\n<p><code>nvm alias default<\/code>\u306b\u3088\u308a\u30010.6.x\u306e\u6700\u65b0\u30d0\u30fc\u30b8\u30e7\u30f3\u304c\u30c7\u30d5\u30a9\u30eb\u30c8\u3067\u6709\u52b9\u5316\u3055\u308c\u308b\u3088\u3046\u306b\u306a\u308a\u3001v0.6.7\u304c\u30ea\u30ea\u30fc\u30b9\u3055\u308c\u3066nvm\u3067\u30a4\u30f3\u30b9\u30c8\u30fc\u30eb\u3057\u305f\u5834\u5408\u3001\u3044\u3061\u3044\u3061.bashrc\u3092\u66f8\u304d\u63db\u3048\u306a\u304f\u3066\u3082\u81ea\u52d5\u7684\u306bv0.6.7\u306b\u5207\u308a\u66ff\u308f\u308b\u3002<\/p>\n","protected":false},"excerpt":{"rendered":"<p>node.js\u306f\u30bd\u30fc\u30b9\u30b3\u30fc\u30c9\u306b\u52a0\u3048\u3066\u3001Windows\u7248\u3001Mac\u7248\u306e\u30a4\u30f3\u30b9\u30c8\u30fc\u30e9\u304c\u7528\u610f\u3055\u308c\u3066\u3044\u308b\u304c\u3001\u306a\u306b\u305bnode.js\u306f\u4eca\u306e\u306a\u304a\u958b\u767a\u9032\u884c\u5f62\u3067\u983b\u7e41\u306b\u30d0\u30fc\u30b8\u30e7\u30f3\u30a2\u30c3\u30d7\u304c\u3055\u308c\u3066\u304a\u308a\u3001\u305d\u306e\u90fd\u5ea6\u30a2\u30f3\u30a4\u30f3\u30b9\u30c8\u30fc\u30eb\uff0f\u518d\u30a4\u30f3\u30b9\u30c8\u30fc\u30eb\u3059\u308b <a href='https:\/\/h2plus.biz\/hiromitsu\/entry\/154' class='excerpt-more'>[&#8230;]<\/a><\/p>\n","protected":false},"author":2,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":[],"categories":[77],"tags":[83,33,82,81,78,79],"_links":{"self":[{"href":"https:\/\/h2plus.biz\/hiromitsu\/wp-json\/wp\/v2\/posts\/154"}],"collection":[{"href":"https:\/\/h2plus.biz\/hiromitsu\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/h2plus.biz\/hiromitsu\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/h2plus.biz\/hiromitsu\/wp-json\/wp\/v2\/users\/2"}],"replies":[{"embeddable":true,"href":"https:\/\/h2plus.biz\/hiromitsu\/wp-json\/wp\/v2\/comments?post=154"}],"version-history":[{"count":0,"href":"https:\/\/h2plus.biz\/hiromitsu\/wp-json\/wp\/v2\/posts\/154\/revisions"}],"wp:attachment":[{"href":"https:\/\/h2plus.biz\/hiromitsu\/wp-json\/wp\/v2\/media?parent=154"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/h2plus.biz\/hiromitsu\/wp-json\/wp\/v2\/categories?post=154"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/h2plus.biz\/hiromitsu\/wp-json\/wp\/v2\/tags?post=154"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}