Hexo-theme-next: hexo algolia失败

Created on 9 Jun 2017  ·  12Comments  ·  Source: iissnan/hexo-theme-next

image

$ hexo algolia
(node:1811) [DEP0061] DeprecationWarning: fs.SyncWriteStream is deprecated.
FATAL Something's wrong. Maybe you can find the solution here: http://hexo.io/docs/troubleshooting.html
Error
    at AlgoliaSearchNodeJS.AlgoliaSearchCore (/Users/yangkai.shen/Documents/MyBlog/node_modules/algoliasearch/src/AlgoliaSearchCore.js:55:11)
    at AlgoliaSearchNodeJS.AlgoliaSearch (/Users/yangkai.shen/Documents/MyBlog/node_modules/algoliasearch/src/AlgoliaSearch.js:11:21)
    at AlgoliaSearchNodeJS.AlgoliaSearchServer (/Users/yangkai.shen/Documents/MyBlog/node_modules/algoliasearch/src/server/builds/AlgoliaSearchServer.js:17:17)
    at new AlgoliaSearchNodeJS (/Users/yangkai.shen/Documents/MyBlog/node_modules/algoliasearch/src/server/builds/node.js:79:23)
    at algoliasearch (/Users/yangkai.shen/Documents/MyBlog/node_modules/algoliasearch/src/server/builds/node.js:68:10)
    at Hexo.module.exports (/Users/yangkai.shen/Documents/MyBlog/node_modules/hexo-algolia/lib/command.js:22:16)
    at Hexo.tryCatcher (/Users/yangkai.shen/Documents/MyBlog/node_modules/bluebird/js/release/util.js:16:23)
    at Hexo.ret (eval at makeNodePromisifiedEval (/usr/local/lib/node_modules/hexo-cli/node_modules/bluebird/js/release/promisify.js:184:12), <anonymous>:13:39)
    at /Users/yangkai.shen/Documents/MyBlog/node_modules/hexo/lib/hexo/index.js:195:9
    at Promise._execute (/Users/yangkai.shen/Documents/MyBlog/node_modules/bluebird/js/release/debuggability.js:300:9)
    at Promise._resolveFromExecutor (/Users/yangkai.shen/Documents/MyBlog/node_modules/bluebird/js/release/promise.js:483:18)
    at new Promise (/Users/yangkai.shen/Documents/MyBlog/node_modules/bluebird/js/release/promise.js:79:10)
    at Hexo.call (/Users/yangkai.shen/Documents/MyBlog/node_modules/hexo/lib/hexo/index.js:191:10)
    at /usr/local/lib/node_modules/hexo-cli/lib/hexo.js:66:17
    at tryCatcher (/usr/local/lib/node_modules/hexo-cli/node_modules/bluebird/js/release/util.js:16:23)
    at Promise._settlePromiseFromHandler (/usr/local/lib/node_modules/hexo-cli/node_modules/bluebird/js/release/promise.js:512:31)
    at Promise._settlePromise (/usr/local/lib/node_modules/hexo-cli/node_modules/bluebird/js/release/promise.js:569:18)
    at Promise._settlePromise0 (/usr/local/lib/node_modules/hexo-cli/node_modules/bluebird/js/release/promise.js:614:10)
    at Promise._settlePromises (/usr/local/lib/node_modules/hexo-cli/node_modules/bluebird/js/release/promise.js:693:18)
    at Async._drainQueue (/usr/local/lib/node_modules/hexo-cli/node_modules/bluebird/js/release/async.js:133:16)
    at Async._drainQueues (/usr/local/lib/node_modules/hexo-cli/node_modules/bluebird/js/release/async.js:143:10)
    at Immediate.Async.drainQueues (/usr/local/lib/node_modules/hexo-cli/node_modules/bluebird/js/release/async.js:17:14)

Most helpful comment

  • 需要设置HEXO_ALGOLIA_INDEXING_KEY环境变量
  • algolia网站设置公开api权限

文档

All 12 comments

要不,重装一下这个插件吧。

  • 需要设置HEXO_ALGOLIA_INDEXING_KEY环境变量
  • algolia网站设置公开api权限

文档

问题是否已解决?

@xkcoding 你好,话说关于你在这个Issues提的问题解决了么? 我安装了一个叫做hexo-fs 的插件,关于这个的报错不显示了(node:1811) [DEP0061] DeprecationWarning: fs.SyncWriteStream is deprecated., 但是它还是会提示之后的错误。

我也遇到相同问题。
@ratelgogo 看了您的文档后,设置了环境变量,但是依然报错

NerodeMacBook-Pro:Blog-hexo nero$ hexo algolia
(node:2290) [DEP0061] DeprecationWarning: fs.SyncWriteStream is deprecated.
INFO  [Algolia] Testing HEXO_ALGOLIA_INDEXING_KEY permissions.
INFO  Start processing
INFO  [Algolia] Identified 25 posts to index.
INFO  [Algolia] Start indexing...
FATAL Something's wrong. Maybe you can find the solution here: http://hexo.io/docs/troubleshooting.html
Error
    at success (/Users/nero/Blog-hexo/node_modules/algoliasearch/src/AlgoliaSearchCore.js:351:32)
    at <anonymous>
    at process._tickCallback (internal/process/next_tick.js:169:7)

Google 报错信息无果,请问有什么办法能够找到更详细的报错内容?

algolia 配置如下

Markdown

只搜索的 apk key 是写到 hexo 的配置文件里面
第一个 apk key 是写到环境变量里。
indexName 也是完全正确的。

hexo 的包版本

NerodeMBP:Blog-hexo nero$ npm list |grep hexo
[email protected] /Users/nero/Blog-hexo
├─┬ [email protected]
│ ├─┬ [email protected]
│ │ ├── [email protected] deduped
│ │ ├── [email protected] deduped
│ │ ├── [email protected] deduped
│ ├─┬ [email protected]
│ ├── [email protected] deduped
│ ├─┬ [email protected]
│ ├─┬ [email protected]
│ ├─┬ [email protected]
├─┬ [email protected]
├─┬ [email protected]
├─┬ [email protected]
│ ├─┬ [email protected]
│ ├── [email protected] deduped
├─┬ [email protected]
├─┬ [email protected]
│ ├─┬ [email protected]
├─┬ [email protected]
│ ├── [email protected] deduped
├─┬ [email protected]
├─┬ [email protected]
│ ├── [email protected] deduped
├─┬ [email protected]
├─┬ [email protected]
│ ├── [email protected] deduped
├─┬ [email protected]
├─┬ [email protected]
│ ├── [email protected] deduped
├─┬ [email protected]
└─┬ [email protected]

我放弃了使用这个插件,改成使用Local Search了。。。一直解决不了

@ratelgogo HEXO_ALGOLIA_INDEXING_KEY这个环境变量我应该设置成什么呢

@xkcoding Search-Only API key(配置增删改权限)

@neroxps 好像是key的权限问题,你的key没有search的权限。

@neroxps 配置环境变量后出现同样的错误 你解决了吗

我解决了这个问题。

我在 algolia 的 dashboard 里重新创建了一个 API,按照说明文档增加了四个权限。

在站点配置文件 algolia 的设置里,把 adminApiKey 这一栏填入新建 API,而不是原来 API 的 admin KEY。

然后$ export HEXO_ALGOLIA_INDEXING_KEY = 此 API 的名字,之后就可以成功 hexo algolia 了。

NexT is rebased into organization repo.
If you want new feature, please, create new in NexT v6.x repo (desirable in English).

There is instructions on English or Chinese how to update from v5.1.x to v 6.0.x

You also may read this for details.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

dev-fancyluo picture dev-fancyluo  ·  3Comments

winterrain5 picture winterrain5  ·  4Comments

jwwangchn picture jwwangchn  ·  3Comments

keltoy picture keltoy  ·  3Comments

iTofu picture iTofu  ·  4Comments