Skip to content

Instantly share code, notes, and snippets.

@eiichi-worker
Last active May 13, 2018 18:08
Show Gist options
  • Save eiichi-worker/2f1a18185e2d5c29594285e958a32e2b to your computer and use it in GitHub Desktop.
Save eiichi-worker/2f1a18185e2d5c29594285e958a32e2b to your computer and use it in GitHub Desktop.
[ブログ済み] gulpの「gulp-gh-pages」がエラー履くようになったときの対応

gulpの「gulp-gh-pages」がエラー履くようになったときの対応

gulpの「gulp-gh-pages」がエラー履くようになった。。
こんなやつ↓

[19:00:31] Starting 'github-page-push'...
E:\Projects\web_ai\node_modules\gift\lib\commit.js:145
      ref1 = /^.+? (.*) (\d+) .*$/.exec(line), m = ref1[0], actor = ref1[1], epoch = ref1[2];
                                                       ^

TypeError: Cannot read property '0' of null
    at Function.module.exports.Commit.actor (E:\Projects\web_ai\node_modules\gift\lib\commit.js:145:56)
    at Function.module.exports.Commit.parse_commits (E:\Projects\web_ai\node_modules\gift\lib\commit.js:111:21)
    at E:\Projects\web_ai\node_modules\gift\lib\commit.js:55:39
    at ChildProcess.exithandler (child_process.js:273:7)
    at ChildProcess.emit (events.js:182:13)
    at maybeClose (internal/child_process.js:957:16)
    at Process.ChildProcess._handle.onexit (internal/child_process.js:246:5)

どうやら、Nodeのバージョンが8以上とか新しい環境で出るようです。
(そういえば10系にした気がする) 対策としては、内部で使っている「gift」ってやつの最新版を明示的に入れてやれば良い。

対象

  • "gulp-gh-pages": "^0.5.4"

対策

package.jsonに以下を追記。

  "devDependencies": {
    ・・・・
    "gift": "^0.10.2"
  }

参考

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment