{"id":23,"date":"2010-12-11T08:47:00","date_gmt":"2010-12-10T23:47:00","guid":{"rendered":"https:\/\/gunmagisgeek.com\/wordpress\/?p=23"},"modified":"2017-02-03T01:20:36","modified_gmt":"2017-02-02T16:20:36","slug":"post-23","status":"publish","type":"post","link":"https:\/\/gunmagisgeek.com\/blog\/node-js\/23","title":{"rendered":"[node.js]Windows\u306b\u3001node.js\u3092\u30a4\u30f3\u30b9\u30c8\u30fc\u30eb\u3059\u308b\uff08Cygwin\uff09"},"content":{"rendered":"<p>\u203b\u8ffd\u8a18<br \/>\n<a href=\"http:\/\/bit.ly\/lLmWzj\">Node.js\u3001Microsoft\u306e\u5354\u529b\u3092\u5f97\u3066Windows\u3078\u6b63\u5f0f\u79fb\u690d <\/a><br \/>\n\u7121\u7406\u306b\u30a4\u30f3\u30b9\u30c8\u30fc\u30eb\u3059\u308b\u3088\u308a\u3001\u4e0a\u8a18\u3092\u5f85\u3063\u305f\u65b9\u304c\u3044\u3044\u304b\u3082\u3002<\/p>\n<p>\u203b\u8ffd\u8a18\uff12<br \/>\n<a href=\"http:\/\/www.publickey1.jp\/blog\/11\/nodejswindowsnodeexe.html\">Node.js\u304c\u30d0\u30fc\u30b8\u30e7\u30f3\u30a2\u30c3\u30d7\u3001\u521d\u306e\u516c\u5f0fWindows\u7248\u300cnode.exe\u300d\u767b\u5834<\/a><br \/>\n\u30d0\u30a4\u30ca\u30ea\u304c\u51fa\u307e\u3057\u305f\u3002<\/p>\n<hr \/>\n<p><a name=\"more\"><\/a>\u7d50\u69cb\u3001\u624b\u9593\u53d6\u3063\u305f\u306e\u3067\u30e1\u30e2<\/p>\n<p>\u53c2\u8003\uff09\u00a0<a href=\"https:\/\/github.com\/ry\/node\/wiki\/Building-node.js-on-Cygwin-(Windows)\">https:\/\/github.com\/ry\/node\/wiki\/Building-node.js-on-Cygwin-(Windows)<\/a><\/p>\n<p><strong>\u25a0Cygwin\u3092\u30a4\u30f3\u30b9\u30c8\u30fc\u30eb<\/strong><\/p>\n<p><a href=\"http:\/\/www.cygwin.com\/\">http:\/\/www.cygwin.com\/<\/a><br \/>\n\u53c2\u8003\uff09\u00a0<a href=\"http:\/\/web.archive.org\/web\/20110111183048\/http:\/\/www.db.is.kyushu-u.ac.jp:80\/rinkou\/cygwin\/cygwin.html\">http:\/\/www.db.is.kyushu-u.ac.jp\/rinkou\/cygwin\/cygwin.html<\/a><\/p>\n<p>cygwin \u5c0e\u5165\u30d1\u30c3\u30b1\u30fc\u30b8\u3067\u306f\u4ee5\u4e0b\u3092\u9078\u629e<\/p>\n<pre class=\"lang:sh highlight:0 decode:true \" >\u30fbWeb    \u2192 wget\r\n\u30fbdevel  \u2192 gcc-g++\r\n\u30fbdevel  \u2192 git\r\n\u30fbdevel  \u2192 make\r\n\u30fbdevel  \u2192 openssl\r\n\u30fblibs   \u2192 openssl-devel\r\n\u30fbdevel  \u2192 pkg-config\r\n\u30fbdevel  \u2192 zlib-devel\r\n\u30fbpython \u2192 python<\/pre>\n<p><span class=\"Apple-style-span\" style=\"font-family: 'MS PGothic'; white-space: normal;\">\u74b0\u5883\u5909\u6570\u300cPATH\u300d \u306b\u300cC:cygwiusrbin;C:cygwinusrlocalbin\u300d\u3092\u8ffd\u53ef<\/span><br \/>\n<span class=\"Apple-style-span\" style=\"font-size: x-small;\">\u203b\u3053\u308c\u3092\u3061\u3083\u3093\u3068\u8a2d\u5b9a\u3057\u3066\u304a\u304b\u306a\u3044\u3068\u3001\u3053\u306e\u3042\u3068\u300cash\u300d\u4e0a\u3067 ls \u3059\u3089\u5b9f\u884c\u3067\u304d\u306a\u3044<\/span><\/p>\n<p><strong>\u25a0Cygwin\u3092\u8d77\u52d5\u3057node.js\u3092\u30a4\u30f3\u30b9\u30c8\u30fc\u30eb\u2026\u2026\u3067\u304d\u306a\u3044\uff1f<\/strong><\/p>\n<p>\u4e00\u5fdc\u3001resolv.conf\u3092\u8a2d\u5b9a\u3057\u3066\u304a\u304f<\/p>\n<pre class=\"lang:sh decode:true \" >$ vim \/etc\/resolv.conf\r\nnameserver 8.8.8.8\r\nnameserver 8.8.4.4<\/pre>\n<p>node.js\u30c0\u30a6\u30f3\u30ed\u30fc\u30c9<br \/>\n<a href=\"http:\/\/nodejs.org\/\">http:\/\/nodejs.org\/<\/a><\/p>\n<pre class=\"lang:sh decode:true \" >$ wget http:\/\/nodejs.org\/dist\/node-v0.3.1.tar.gz \r\n$ tar xvf \/node-v0.3.1.tar.gz \r\n$ cd node-v0.3.1<\/pre>\n<p>node.js \u30a4\u30f3\u30b9\u30c8\u30fc\u30eb\u6e96\u5099\u3000\u30e9\u30a4\u30d6\u30e9\u30ea\u30c1\u30a7\u30c3\u30af<\/p>\n<pre class=\"lang:sh decode:true \" >$ .\/configure<\/pre>\n<p>\u3057\u304b\u3057\u3001\u4ee5\u4e0b\u306e\u3088\u3046\u306a\u30a8\u30e9\u30fc\u304c\u51fa\u3066configure\u304c\u901a\u3089\u306a\u3044\u3002<\/p>\n<pre class=\"lang:sh decode:true \" >5 [main] python 2244 C:cygwinbinpython.exe: *** fatal error - unable to remap \\?C:cygwinlibpython2.6lib-dynloadtime.dll to same address as parent: 0x2D0000 != 0x3C0000&amp;lt;\r\n11 [main] python 3392 fork: child 2244 - died waiting for dll loading, errno 11\r\n\r\nwscript:165: error: could not configure a c compiler!<\/pre>\n<p>\u3053\u307e\u3063\u305f\u3068\u304d\u306f\u3001\uff27\uff4f\uff4f\uff47\uff4c\uff45\u3002<\/p>\n<p><strong>\u25a0ash\u4e0a\u3067node.js\u3092\u30a4\u30f3\u30b9\u30c8\u30fc\u30eb\u3059\u308b<\/strong><\/p>\n<p>\u53c2\u8003\uff09\u00a0<span class=\"removed_link\" title=\"http:\/\/avalanche123.com\/post\/855374337\/nodejs-mongodb-tinyurl\">http:\/\/avalanche123.com\/post\/855374337\/nodejs-mongodb-tinyurl<\/span><\/p>\n<p>\u3044\u3063\u305f\u3093Cygwin\u3092\u7d42\u4e86\u3059\u308b\u3002<br \/>\n\u4ee5\u4e0b\u306e\u30d5\u30a9\u30eb\u30c0\u304b\u3089ash.exe\u3092\u8d77\u52d5 <\/p>\n<pre class=\"lang:sh decode:true \" >C:cygwin\/bin\/ash.exe<\/pre>\n<p>ash\u4e0a\u3067rebaseall\u3092\u5b9f\u884c<\/p>\n<pre class=\"lang:sh decode:true \" >$ rebaseall<\/pre>\n<p>\u81ea\u5206\u306e\u74b0\u5883\u3067\u306f\u3053\u3053\u3067Temp\u306b\u66f8\u304d\u8fbc\u3081\u306a\u3044\u3068\u30a8\u30e9\u30fc\u304c\u3067\u305f<\/p>\n<pre class=\"lang:sh decode:true \" >rebaseall: '\/cygdrive\/c\/Users\/hoge\/AppData\/Local\/Temp' is not writable<\/pre>\n<p>rebaseall\u3092\u30a8\u30c7\u30a3\u30bf\u3067\u958b\u304d\u30c6\u30f3\u30dd\u30e9\u30ea\u306e\u6307\u5b9a\u30d5\u30a9\u30eb\u30c0\u3092\u5909\u66f4\u3057\u3066\u518d\u5ea6ash\u4e0a\u3067rebaseall\u3092\u5b9f\u884c<\/p>\n<pre class=\"lang:sh highlight:0 decode:true \" >#TmpDir=&quot;${TMP:-${TEMP:-\/tmp}}&quot;\r\nTmpDir=&quot;\/tmp&quot;\r\n<\/pre>\n<p>\u30e1\u30c3\u30bb\u30fc\u30b8\u304c\u306a\u306b\u3082\u51fa\u529b\u3055\u308c\u306a\u3044\u306e\u3067\u6210\u529f\u3057\u305f\u306e\u304b\u5931\u6557\u3057\u305f\u306e\u304b\u308f\u304b\u308a\u306b\u304f\u3044\u304c\u3001\u30b3\u30de\u30f3\u30c9\u304c\u6b63\u3057\u304f\u5b9f\u884c\u3055\u308c\u308b\u3068\u3061\u3087\u3063\u3068\u5f85\u305f\u3055\u308c\u305f\u306e\u3061\u30b3\u30f3\u30bd\u30fc\u30eb\u306b\u64cd\u4f5c\u304c\u623b\u308b\u3002<\/p>\n<p>\u305d\u306e\u307e\u307eash\u4e0a\u3067\u3000node-v0.3.1\u30c7\u30a3\u30ec\u30af\u30c8\u30ea\u306b\u79fb\u52d5\u3057\u6539\u3081\u3066configre\u5b9f\u884c<\/p>\n<pre class=\"lang:sh decode:true \" >$ .\/configure<\/pre>\n<p>\u3044\u308d\u3044\u308d\u898b\u3064\u304b\u3089\u306a\u3044\u30e9\u30a4\u30d6\u30e9\u30ea\u3082\u3042\u308b\u3051\u308c\u3069\u3001\u3068\u308a\u3042\u3048\u305a<br \/>\n\u300c&#8217;configure&#8217; finished successfully\u300d<br \/>\n\u304c\u8868\u793a\u3055\u308c\u308c\u3070\u30d3\u30eb\u30c9\u3067\u304d\u308b\u306e\u3067\u3001make\u3059\u308b\u3002<\/p>\n<pre class=\"lang:sh decode:true \" >$ make\r\n$ make install<\/pre>\n<p><strong>\u25a0Cygwin\u3092\u8d77\u52d5\u3057make test<\/strong><\/p>\n<p>ash\u3092\u7d42\u4e86\u3057\u3001cygwin\u3092\u8d77\u52d5\u3001 node-v0.3.1 \u30c7\u30a3\u30ec\u30af\u30c8\u30ea\u3078\u79fb\u52d5\u3057\u30c6\u30b9\u30c8\u958b\u59cb<\/p>\n<pre class=\"lang:sh decode:true \" >$ make test\u30002&gt;&amp;1 | tee node-test.log<\/pre>\n<p>node.js\u30b5\u30a4\u30c8\u306e\u30b5\u30f3\u30d7\u30eb\u3092\u30c6\u30b9\u30c8\u3057\u3066\u307f\u308b\u3002<\/p>\n<pre class=\"lang:js decode:true \" >\/\/example.js\r\nvar http = require('http');\r\nhttp.createServer(function (req, res) {\r\n  res.writeHead(200, {'Content-Type': 'text\/plain'});\r\n  res.end('Hello Worldn');\r\n}).listen(8124, &quot;127.0.0.1&quot;);\r\nconsole.log('Server running at http:\/\/127.0.0.1:8124\/');\r\n<\/pre>\n<pre class=\"lang:sh decode:true \" >$ node example.js<\/pre>\n<p>\u30d6\u30e9\u30a6\u30b6\u3067http:\/\/127.0.0.1:8124\/\u306b\u30a2\u30af\u30bb\u30b9\u3057\u3001\u300cHello World\u300d\u3068\u8868\u793a\u3055\u308c\u308c\u3070\u5b8c\u4e86<\/p>\n<p>\u4e0a\u8a18\u306e\u65b9\u6cd5\u306f\u3001\u591a\u6570\u306e\u300cnot found\u300d\u304c\u51fa\u305f\u307e\u307e\u30d3\u30eb\u30c9\u3057\u3066\u3057\u307e\u3063\u3066\u3044\u308b\u306e\u3067\u3046\u307e\u304f\u52d5\u304b\u306a\u3044API\u304c\u7d50\u69cb\u3042\u308b\u304b\u3082\u3002 <\/p>\n","protected":false},"excerpt":{"rendered":"<p>\u203b\u8ffd\u8a18 Node.js\u3001Microsoft\u306e\u5354\u529b\u3092&hellip;<\/p>\n","protected":false},"author":1,"featured_media":5090,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[5],"tags":[],"class_list":["post-23","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-node-js","has-post-thumbnail-archive"],"_links":{"self":[{"href":"https:\/\/gunmagisgeek.com\/blog\/wp-json\/wp\/v2\/posts\/23","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/gunmagisgeek.com\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/gunmagisgeek.com\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/gunmagisgeek.com\/blog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/gunmagisgeek.com\/blog\/wp-json\/wp\/v2\/comments?post=23"}],"version-history":[{"count":8,"href":"https:\/\/gunmagisgeek.com\/blog\/wp-json\/wp\/v2\/posts\/23\/revisions"}],"predecessor-version":[{"id":392,"href":"https:\/\/gunmagisgeek.com\/blog\/wp-json\/wp\/v2\/posts\/23\/revisions\/392"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/gunmagisgeek.com\/blog\/wp-json\/wp\/v2\/media\/5090"}],"wp:attachment":[{"href":"https:\/\/gunmagisgeek.com\/blog\/wp-json\/wp\/v2\/media?parent=23"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/gunmagisgeek.com\/blog\/wp-json\/wp\/v2\/categories?post=23"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/gunmagisgeek.com\/blog\/wp-json\/wp\/v2\/tags?post=23"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}