➜ Hexo-theme-zilan git:(master) ✗ hexo g (node:28561) [DEP0061] DeprecationWarning: fs.SyncWriteStream is deprecated. INFO Start processing FATAL Something's wrong. Maybe you can find the solution here: http://hexo.io/docs/troubleshooting.html TypeError: Cannot set property 'lastIndex' of undefined at highlight (/Users/liyuankun/MyOwnGit/Hexo-theme-zilan/node_modules/highlight.js/lib/highlight.js:511:35) at /Users/liyuankun/MyOwnGit/Hexo-theme-zilan/node_modules/highlight.js/lib/highlight.js:561:21 at Array.forEach (<anonymous>) at Object.highlightAuto (/Users/liyuankun/MyOwnGit/Hexo-theme-zilan/node_modules/highlight.js/lib/highlight.js:560:40) at /Users/liyuankun/MyOwnGit/Hexo-theme-zilan/node_modules/hexo-util/lib/highlight.js:117:25 at highlight (/Users/liyuankun/MyOwnGit/Hexo-theme-zilan/node_modules/hexo-util/lib/highlight.js:120:7) at highlightUtil (/Users/liyuankun/MyOwnGit/Hexo-theme-zilan/node_modules/hexo-util/lib/highlight.js:22:14) at /Users/liyuankun/MyOwnGit/Hexo-theme-zilan/node_modules/hexo/lib/plugins/filter/before_post_render/backtick_code_block.js:62:15 at String.replace (<anonymous>) at Hexo.backtickCodeBlock (/Users/liyuankun/MyOwnGit/Hexo-theme-zilan/node_modules/hexo/lib/plugins/filter/before_post_render/backtick_code_block.js:14:31) at Hexo.tryCatcher (/Users/liyuankun/MyOwnGit/Hexo-theme-zilan/node_modules/bluebird/js/release/util.js:16:23) at Hexo.<anonymous> (/Users/liyuankun/MyOwnGit/Hexo-theme-zilan/node_modules/bluebird/js/release/method.js:15:34) at Promise.each.filter (/Users/liyuankun/MyOwnGit/Hexo-theme-zilan/node_modules/hexo/lib/extend/filter.js:63:65) at tryCatcher (/Users/liyuankun/MyOwnGit/Hexo-theme-zilan/node_modules/bluebird/js/release/util.js:16:23) at Object.gotValue (/Users/liyuankun/MyOwnGit/Hexo-theme-zilan/node_modules/bluebird/js/release/reduce.js:155:18) at Object.gotAccum (/Users/liyuankun/MyOwnGit/Hexo-theme-zilan/node_modules/bluebird/js/release/reduce.js:144:25) at Object.tryCatcher (/Users/liyuankun/MyOwnGit/Hexo-theme-zilan/node_modules/bluebird/js/release/util.js:16:23) at Promise._settlePromiseFromHandler (/Users/liyuankun/MyOwnGit/Hexo-theme-zilan/node_modules/bluebird/js/release/promise.js:512:31) at Promise._settlePromise (/Users/liyuankun/MyOwnGit/Hexo-theme-zilan/node_modules/bluebird/js/release/promise.js:569:18) at Promise._settlePromiseCtx (/Users/liyuankun/MyOwnGit/Hexo-theme-zilan/node_modules/bluebird/js/release/promise.js:606:10) at Async._drainQueue (/Users/liyuankun/MyOwnGit/Hexo-theme-zilan/node_modules/bluebird/js/release/async.js:138:12) at Async._drainQueues (/Users/liyuankun/MyOwnGit/Hexo-theme-zilan/node_modules/bluebird/js/release/async.js:143:10)
Root cause
hexo-fs 老版本里有一行:
1
exports.SyncWriteStream = fs.SyncWriteStream;
跟nodejs v8 有冲突。所以要更新 hexo-fs >= ^0.2.0
Solutions
Fix 1 use old version of nodejs
用nvm管理node版本。发现切换node后,zsh: command not found: hexo。
重新npm install hexo-cli -g 就好了