➜ blog_source git:(master) ✗ hexo -v ERROR Plugin load failed: hexo-generator-baidu-sitemap ReferenceError: hexo is not defined at Object.<anonymous> (/usr/local/git_projects/blog_source/node_modules/hexo-generator-baidu-sitemap/baidusitemap.js:4:10) at Module._compile (module.js:541:32) at Object.Module._extensions..js (module.js:550:10) at Module.load (module.js:458:32) at tryModuleLoad (module.js:417:12) at Function.Module._load (module.js:409:3) at Module.require (module.js:468:17) at require (/usr/local/git_projects/blog_source/node_modules/hexo/lib/hexo/index.js:213:21) at /usr/local/git_projects/blog_source/node_modules/hexo-generator-baidu-sitemap/index.js:6:38 at /usr/local/git_projects/blog_source/node_modules/hexo/lib/hexo/index.js:229:12 at tryCatcher (/usr/local/git_projects/blog_source/node_modules/bluebird/js/release/util.js:16:23) at Promise._settlePromiseFromHandler (/usr/local/git_projects/blog_source/node_modules/bluebird/js/release/promise.js:502:31) at Promise._settlePromise (/usr/local/git_projects/blog_source/node_modules/bluebird/js/release/promise.js:559:18) at Promise._settlePromise0 (/usr/local/git_projects/blog_source/node_modules/bluebird/js/release/promise.js:604:10) at Promise._settlePromises (/usr/local/git_projects/blog_source/node_modules/bluebird/js/release/promise.js:683:18) at Promise._fulfill (/usr/local/git_projects/blog_source/node_modules/bluebird/js/release/promise.js:628:18) at Promise._resolveCallback (/usr/local/git_projects/blog_source/node_modules/bluebird/js/release/promise.js:423:57) at Promise._settlePromiseFromHandler (/usr/local/git_projects/blog_source/node_modules/bluebird/js/release/promise.js:514:17) at Promise._settlePromise (/usr/local/git_projects/blog_source/node_modules/bluebird/js/release/promise.js:559:18) at Promise._settlePromise0 (/usr/local/git_projects/blog_source/node_modules/bluebird/js/release/promise.js:604:10) at Promise._settlePromises (/usr/local/git_projects/blog_source/node_modules/bluebird/js/release/promise.js:683:18) at Promise._fulfill (/usr/local/git_projects/blog_source/node_modules/bluebird/js/release/promise.js:628:18)
解决方法: if your hexo version is 2.x.x, you should install as follow:
# taoyi @ taoyi-mac in ~/git_projects/GitHub/blog_source on git:master x [18:11:36] $ hexo generate (node:51431) [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 Error: Cannot find module 'highlight.js/lib/languages/shell' at Function.Module._resolveFilename (module.js:555:15) at Function.Module._load (module.js:482:25) at Module.require (module.js:604:17) at require (internal/module.js:11:18) at loadLanguage (/Users/taoyi/git_projects/GitHub/blog_source/node_modules/hexo/node_modules/hexo-util/lib/highlight.js:93:31) at tryLanguage (/Users/taoyi/git_projects/GitHub/blog_source/node_modules/hexo/node_modules/hexo-util/lib/highlight.js:100:3) at highlight (/Users/taoyi/git_projects/GitHub/blog_source/node_modules/hexo/node_modules/hexo-util/lib/highlight.js:136:8) at highlightUtil (/Users/taoyi/git_projects/GitHub/blog_source/node_modules/hexo/node_modules/hexo-util/lib/highlight.js:22:14) at /Users/taoyi/git_projects/GitHub/blog_source/node_modules/hexo/lib/plugins/filter/before_post_render/backtick_code_block.js:62:15 at String.replace (<anonymous>) at Hexo.backtickCodeBlock (/Users/taoyi/git_projects/GitHub/blog_source/node_modules/hexo/lib/plugins/filter/before_post_render/backtick_code_block.js:15:31) at Hexo.tryCatcher (/Users/taoyi/git_projects/GitHub/blog_source/node_modules/bluebird/js/release/util.js:16:23) at Hexo.<anonymous> (/Users/taoyi/git_projects/GitHub/blog_source/node_modules/bluebird/js/release/method.js:15:34) at /Users/taoyi/git_projects/GitHub/blog_source/node_modules/hexo/lib/extend/filter.js:68:35 at tryCatcher (/Users/taoyi/git_projects/GitHub/blog_source/node_modules/bluebird/js/release/util.js:16:23) at Object.gotValue (/Users/taoyi/git_projects/GitHub/blog_source/node_modules/bluebird/js/release/reduce.js:145:18) at Object.gotAccum (/Users/taoyi/git_projects/GitHub/blog_source/node_modules/bluebird/js/release/reduce.js:134:25) at Object.tryCatcher (/Users/taoyi/git_projects/GitHub/blog_source/node_modules/bluebird/js/release/util.js:16:23) at Promise._settlePromiseFromHandler (/Users/taoyi/git_projects/GitHub/blog_source/node_modules/bluebird/js/release/promise.js:502:31) at Promise._settlePromise (/Users/taoyi/git_projects/GitHub/blog_source/node_modules/bluebird/js/release/promise.js:559:18) at Promise._settlePromiseCtx (/Users/taoyi/git_projects/GitHub/blog_source/node_modules/bluebird/js/release/promise.js:596:10) at Async._drainQueue (/Users/taoyi/git_projects/GitHub/blog_source/node_modules/bluebird/js/release/async.js:143:12) at Async._drainQueues (/Users/taoyi/git_projects/GitHub/blog_source/node_modules/bluebird/js/release/async.js:148:10) at Immediate.Async.drainQueues [as _onImmediate] (/Users/taoyi/git_projects/GitHub/blog_source/node_modules/bluebird/js/release/async.js:17:14) at runCallback (timers.js:773:18) at tryOnImmediate (timers.js:734:5) at processImmediate [as _immediateCallback] (timers.js:711:5)
The following dependencies are satisfied by their declared version range, but the installed versions are behind. You can install the latest versions without modifying your package file by using npm update. If you want to update the dependencies in your package file anyway, run ncu -a.
$ npm-check -u -g The global path you are searching is: /usr/local/lib/node_modules ? Choose which packages to update. (Press <space> to select) Minor Update New backwards-compatible features. ❯◯ appium 1.16.0 ❯ 1.17.0 https://github.com/appium/appium#readme ◯ npm 6.10.1 ❯ 6.14.4 https://docs.npmjs.com/ Major Update Potentially breaking API changes. Use caution. ◯ node 12.6.0 ❯ 13.12.0 https://github.com/aredridel/node-bin-gen#readme Space to select. Enter to start upgrading. Control-C to cancel.
gitment: enable:true mint:true# RECOMMEND, A mint on Gitment, to support count, language and proxy_gateway count:true# Show comments count in post meta area lazy:false# Comments lazy loading with a button cleanly:false# Hide 'Powered by ...' on footer, and more language:# Force language, or auto switch by theme github_user:shadow000902# 必填,填入你GitHub的用户名 github_repo:shadow000902.github.io# 必填,填入你的任意一个GitHub仓库的仓库名,用于存放评论 client_id:{刚才申请的ClientID}# MUST HAVE, Github client id for the Gitment client_secret:{刚才申请的ClientSecret}# EITHER this or proxy_gateway, Github access secret token for the Gitment proxy_gateway:# Address of api proxy, See: https://github.com/aimingoo/intersect redirect_protocol:# Protocol of redirect_uri with force_redirect_protocol when mint enabled