{"id":2891,"date":"2018-05-07T22:43:08","date_gmt":"2018-05-07T13:43:08","guid":{"rendered":"https:\/\/tech.akat.info\/?p=2891"},"modified":"2018-05-07T22:43:08","modified_gmt":"2018-05-07T13:43:08","slug":"gulp-%e3%81%a7-hello-world","status":"publish","type":"post","link":"https:\/\/tech.akat.info\/?p=2891","title":{"rendered":"gulp \u3067 hello world!"},"content":{"rendered":"<h1>\u6982\u8981<\/h1>\n<p><a href=\"https:\/\/dotinstall.com\/lessons\/basic_gulp\">gulp\u5165\u9580<\/a>\u3092\u898b\u305f\u305f\u3081\u3001\u30e1\u30e2\u3002<br \/>\ngulp\u306f\u30d5\u30ed\u30f3\u30c8\u30a8\u30f3\u30c9\u306e\u30bf\u30b9\u30af\u3092\u81ea\u52d5\u5316\u3059\u308b\u30bf\u30b9\u30af\u30e9\u30f3\u30ca\u30fc\u3068\u547c\u3070\u308c\u308b\u3082\u306e\u3002<\/p>\n<h1>\u30a4\u30f3\u30b9\u30c8\u30fc\u30eb<\/h1>\n<p>docker\u3067centos\u3092\u7528\u610f\u3057\u3066\u3001gulp\u3092\u30a4\u30f3\u30b9\u30c8\u30fc\u30eb\u3057\u305f\u3002<\/p>\n<pre class=\"brush: plain; title: ; notranslate\" title=\"\">\r\nPS C:\\WINDOWS\\system32&gt; docker run -it centos:centos6\r\n# yum -y install epel-release\r\n# yum -y install nodejs npm\r\n# node -v\r\nv0.10.48\r\n# npm -v\r\n1.3.6\r\n# npm install gulp -g\r\nnpm http GET https:\/\/registry.npmjs.org\/gulp\r\nnpm http GET https:\/\/registry.npmjs.org\/gulp\r\nnpm http GET https:\/\/registry.npmjs.org\/gulp\r\nnpm ERR! Error: CERT_UNTRUSTED\r\nnpm ERR!     at SecurePair.&lt;anonymous&gt; (tls.js:1430:32)\r\nnpm ERR!     at SecurePair.emit (events.js:92:17)\r\nnpm ERR!     at SecurePair.maybeInitFinished (tls.js:1029:10)\r\nnpm ERR!     at CleartextStream.read &#x5B;as _read] (tls.js:521:13)\r\nnpm ERR!     at CleartextStream.Readable.read (_stream_readable.js:341:10)\r\nnpm ERR!     at EncryptedStream.write &#x5B;as _write] (tls.js:418:25)\r\nnpm ERR!     at doWrite (_stream_writable.js:226:10)\r\nnpm ERR!     at writeOrBuffer (_stream_writable.js:216:5)\r\nnpm ERR!     at EncryptedStream.Writable.write (_stream_writable.js:183:11)\r\nnpm ERR!     at write (_stream_readable.js:602:24)\r\nnpm ERR! If you need help, you may report this log at:\r\nnpm ERR!     &lt;http:\/\/github.com\/isaacs\/npm\/issues&gt;\r\nnpm ERR! or email it to:\r\nnpm ERR!     &lt;npm-@googlegroups.com&gt;\r\n\r\nnpm ERR! System Linux 4.9.87-linuxkit-aufs\r\nnpm ERR! command &quot;node&quot; &quot;\/usr\/bin\/npm&quot; &quot;install&quot; &quot;gulp&quot; &quot;-g&quot;\r\nnpm ERR! cwd \/\r\nnpm ERR! node -v v0.10.48\r\nnpm ERR! npm -v 1.3.6\r\nnpm ERR!\r\nnpm ERR! Additional logging details can be found in:\r\nnpm ERR!     \/npm-debug.log\r\nnpm ERR! not ok code 0\r\n\r\n# npm config set strict-ssl false\r\n# npm install gulp -g\r\n# mkdir mysite\r\n# cd mysite\/\r\n# npm init\r\n# npm install --save-dev gulp # \u30d5\u30a9\u30eb\u30c0\u306bgulp\u3092\u30a4\u30f3\u30b9\u30c8\u30fc\u30eb\u3059\u308b\r\n# npm config set strict-ssl true\r\n<\/pre>\n<h1>hello world! <\/h1>\n<p>gulpfile.js\u3092gulp\u3092\u30a4\u30f3\u30b9\u30c8\u30fc\u30eb\u3057\u305f\u30d5\u30a9\u30eb\u30c0\u306b\u7528\u610f\u3059\u308b\u3002<\/p>\n<pre class=\"brush: plain; title: gulpfile.js; notranslate\" title=\"gulpfile.js\">\r\nvar gulp = require('gulp');\r\n\r\ngulp.task('hello', function() {\r\n    console.log('hello world!');\r\n});\r\n\r\ngulp.task('default',&#x5B;'hello']);\r\n<\/pre>\n<p>gulp\u3092\u5b9f\u884c\u3059\u308b\u3002<\/p>\n<pre class=\"brush: plain; title: ; notranslate\" title=\"\">\r\n# gulp\r\n&#x5B;13:06:58] Using gulpfile ~\/mysite\/gulpfile.js\r\n&#x5B;13:06:58] Starting 'hello'...\r\nhello world!\r\n&#x5B;13:06:58] Finished 'hello' after 289 \u03bcs\r\n&#x5B;13:06:58] Starting 'default'...\r\n&#x5B;13:06:58] Finished 'default' after 12 \u03bcs\r\n# gulp hello\r\n&#x5B;13:07:01] Using gulpfile ~\/mysite\/gulpfile.js\r\n&#x5B;13:07:01] Starting 'hello'...\r\nhello world!\r\n&#x5B;13:07:01] Finished 'hello' after\r\n<\/pre>\n<p>\u305d\u306e\u4ed6\u3001\u30d7\u30e9\u30b0\u30a4\u30f3\u3092\u30a4\u30f3\u30b9\u30c8\u30fc\u30eb\u3057\u3066webserver\u3092\u7acb\u3061\u4e0a\u3052\u305f\u308a\u3001watch(\u66f4\u65b0\u3092\u76e3\u8996)\u306a\u3069\u304c\u53ef\u80fd\u3002<\/p>\n<h1>\u53c2\u8003<\/h1>\n<p><a href=\"https:\/\/blog.yug1224.com\/archives\/563d9b67bf652a600632d01e\">npm install \u3067 SSL Error \u306b\u306a\u3063\u305f\u6642\u306e\u5bfe\u51e6\u6cd5\u3002<\/a><\/p>\n","protected":false},"excerpt":{"rendered":"<p>\u6982\u8981 gulp\u5165\u9580\u3092\u898b\u305f\u305f\u3081\u3001\u30e1\u30e2\u3002 gulp\u306f\u30d5\u30ed\u30f3\u30c8\u30a8\u30f3\u30c9\u306e\u30bf\u30b9\u30af\u3092\u81ea\u52d5\u5316\u3059\u308b\u30bf\u30b9\u30af\u30e9\u30f3\u30ca\u30fc\u3068\u547c\u3070\u308c\u308b\u3082\u306e\u3002 \u30a4\u30f3\u30b9\u30c8\u30fc\u30eb docker\u3067centos\u3092\u7528\u610f\u3057\u3066\u3001gulp\u3092\u30a4\u30f3\u30b9\u30c8\u30fc\u30eb\u3057\u305f\u3002 PS C:\\WINDOW [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"_monsterinsights_skip_tracking":false,"_monsterinsights_sitenote_active":false,"_monsterinsights_sitenote_note":"","_monsterinsights_sitenote_category":0,"footnotes":""},"categories":[1],"tags":[],"_links":{"self":[{"href":"https:\/\/tech.akat.info\/index.php?rest_route=\/wp\/v2\/posts\/2891"}],"collection":[{"href":"https:\/\/tech.akat.info\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/tech.akat.info\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/tech.akat.info\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/tech.akat.info\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=2891"}],"version-history":[{"count":1,"href":"https:\/\/tech.akat.info\/index.php?rest_route=\/wp\/v2\/posts\/2891\/revisions"}],"predecessor-version":[{"id":2892,"href":"https:\/\/tech.akat.info\/index.php?rest_route=\/wp\/v2\/posts\/2891\/revisions\/2892"}],"wp:attachment":[{"href":"https:\/\/tech.akat.info\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=2891"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/tech.akat.info\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=2891"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/tech.akat.info\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=2891"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}