sergiolepore / hexo-tag-emojis

Use Emojis on your blog posts! :)
MIT License
30 stars 2 forks source link

Install Error #9

Closed s10wen closed 9 years ago

s10wen commented 9 years ago

I ran npm install hexo-tag-emojis --save and in my _config.yml have:

emojis:
  image_dir: images/emojis

plugins:
  - hexo-tag-emojis

Then ran hexo emojis install and I get:

༼ つ ◕_◕ ༽つ⚡  hexo emojis install
ERROR Plugin load failed: hexo-tag-emojis
TypeError: Cannot read property 'html_tag' of undefined
    at /Users/simonowen/GitHub/hexo/s10wen.github.io/node_modules/hexo-tag-emojis/index.js:1:89
    at /Users/simonowen/GitHub/hexo/s10wen.github.io/node_modules/hexo/lib/hexo/index.js:229:12
    at tryCatcher (/Users/simonowen/GitHub/hexo/s10wen.github.io/node_modules/hexo/node_modules/bluebird/js/main/util.js:24:31)
    at Promise._settlePromiseFromHandler (/Users/simonowen/GitHub/hexo/s10wen.github.io/node_modules/hexo/node_modules/bluebird/js/main/promise.js:454:31)
    at Promise._settlePromiseAt (/Users/simonowen/GitHub/hexo/s10wen.github.io/node_modules/hexo/node_modules/bluebird/js/main/promise.js:530:18)
    at Promise._settlePromises (/Users/simonowen/GitHub/hexo/s10wen.github.io/node_modules/hexo/node_modules/bluebird/js/main/promise.js:646:14)
    at Async._drainQueue (/Users/simonowen/GitHub/hexo/s10wen.github.io/node_modules/hexo/node_modules/bluebird/js/main/async.js:175:16)
    at Async._drainQueues (/Users/simonowen/GitHub/hexo/s10wen.github.io/node_modules/hexo/node_modules/bluebird/js/main/async.js:185:10)
    at Async.drainQueues (/Users/simonowen/GitHub/hexo/s10wen.github.io/node_modules/hexo/node_modules/bluebird/js/main/async.js:15:14)
    at process._tickCallback (node.js:415:13)
Usage: hexo <command>

Any ideas please?

sergiolepore commented 9 years ago

@s10wen Hexo version?

s10wen commented 9 years ago
hexo-cli: 0.1.4
os: Darwin 14.3.0 darwin x64
http_parser: 1.0
node: 0.10.24
v8: 3.14.5.9
ares: 1.9.0-DEV
uv: 0.10.21
zlib: 1.2.3
modules: 11
openssl: 1.0.1e
Gtskk commented 9 years ago

I have the same error. When I type"hexo version",I get the following:

hexo: 3.0.1
os: Windows_NT 6.1.7601 win32 ia32
http_parser: 2.3
node: 0.12.2
v8: 3.28.73
uv: 1.4.2-node1
zlib: 1.2.8
modules: 14
openssl: 1.0.1m

After a few attempts, I finally figured it out. In hexo of new version hexo.util is removed, and the hexo-util package is required. So I think adding the dependency of hexo-util is the answer.

s10wen commented 9 years ago

Thanks @Gtskk but no luck for me (unless I'm missing a step?)

I installed the dependancy: npm install hexo-util --save

Then hexo emoji again: npm install hexo-tag-emojis --save

Then added some test code to a blog post: {% emoji heart 32 custom_class1,custom_class2 %}

And updated the _config.yml (trying both the root or theme not sure if this matters?):

plugins:
  - hexo-tag-emojis

But after starting the server I get:

༼ つ ◕_◕ ༽つ⚡  hexo server
ERROR Plugin load failed: hexo-tag-emojis
TypeError: Cannot read property 'html_tag' of undefined
    at /Users/simonowen/GitHub/hexo/s10wen.github.io/node_modules/hexo-tag-emojis/index.js:1:89
    at /Users/simonowen/GitHub/hexo/s10wen.github.io/node_modules/hexo/lib/hexo/index.js:229:12
    at tryCatcher (/Users/simonowen/GitHub/hexo/s10wen.github.io/node_modules/hexo/node_modules/bluebird/js/main/util.js:24:31)
    at Promise._settlePromiseFromHandler (/Users/simonowen/GitHub/hexo/s10wen.github.io/node_modules/hexo/node_modules/bluebird/js/main/promise.js:454:31)
    at Promise._settlePromiseAt (/Users/simonowen/GitHub/hexo/s10wen.github.io/node_modules/hexo/node_modules/bluebird/js/main/promise.js:530:18)
    at Promise._settlePromises (/Users/simonowen/GitHub/hexo/s10wen.github.io/node_modules/hexo/node_modules/bluebird/js/main/promise.js:646:14)
    at Async._drainQueue (/Users/simonowen/GitHub/hexo/s10wen.github.io/node_modules/hexo/node_modules/bluebird/js/main/async.js:175:16)
    at Async._drainQueues (/Users/simonowen/GitHub/hexo/s10wen.github.io/node_modules/hexo/node_modules/bluebird/js/main/async.js:185:10)
    at Async.drainQueues (/Users/simonowen/GitHub/hexo/s10wen.github.io/node_modules/hexo/node_modules/bluebird/js/main/async.js:15:14)
    at process._tickCallback (node.js:415:13)
sergiolepore commented 9 years ago

I'll be working on a new version for Hexo v3, this plugin is for Hexo v2. I'll keep you updated!

s10wen commented 9 years ago

@sergiolepore ace, thanks, I'll look out for updates and test when available.

s10wen commented 9 years ago

@sergiolepore any movement on this please? or anything I can do to help, or can you point me in the right direction? Cheers.

Gtskk commented 9 years ago

The following steps may help:

  1. runnpm install hexo-util --save
  2. Modify line 1 tovar htmlTag = require('hexo-util').htmlTag, in node_modules/hexo-tag-emojis/index.js file

Then it will be ok. I have also issued a pull request.

s10wen commented 9 years ago

@Gtskk thanks, I tried this but get Template render error: unknown block tag: emoji.

s10wen commented 9 years ago

Here's the full log if it helps:

FATAL Something's wrong. Maybe you can find the solution here: http://hexo.io/docs/troubleshooting.html
Template render error: unknown block tag: emoji
    at Error.exports.TemplateError (/Users/simonowen/GitHub/hexo/s10wen.github.io/node_modules/hexo/node_modules/nunjucks/src/lib.js:51:19)
    at Object.extend.fail (/Users/simonowen/GitHub/hexo/s10wen.github.io/node_modules/hexo/node_modules/nunjucks/src/parser.js:64:15)
    at Object.extend.parseStatement (/Users/simonowen/GitHub/hexo/s10wen.github.io/node_modules/hexo/node_modules/nunjucks/src/parser.js:544:18)
    at Object.extend.parseNodes (/Users/simonowen/GitHub/hexo/s10wen.github.io/node_modules/hexo/node_modules/nunjucks/src/parser.js:1151:30)
    at Object.extend.parseAsRoot (/Users/simonowen/GitHub/hexo/s10wen.github.io/node_modules/hexo/node_modules/nunjucks/src/parser.js:1177:42)
    at Object.module.exports.parse (/Users/simonowen/GitHub/hexo/s10wen.github.io/node_modules/hexo/node_modules/nunjucks/src/parser.js:1199:18)
    at Object.module.exports.compile (/Users/simonowen/GitHub/hexo/s10wen.github.io/node_modules/hexo/node_modules/nunjucks/src/compiler.js:1118:48)
    at Obj.extend._compile (/Users/simonowen/GitHub/hexo/s10wen.github.io/node_modules/hexo/node_modules/nunjucks/src/environment.js:444:35)
    at Obj.extend.compile (/Users/simonowen/GitHub/hexo/s10wen.github.io/node_modules/hexo/node_modules/nunjucks/src/environment.js:433:18)
    at null.<anonymous> (/Users/simonowen/GitHub/hexo/s10wen.github.io/node_modules/hexo/node_modules/nunjucks/src/environment.js:378:22)
    at Object.exports.withPrettyErrors (/Users/simonowen/GitHub/hexo/s10wen.github.io/node_modules/hexo/node_modules/nunjucks/src/lib.js:24:16)
    at Obj.extend.render (/Users/simonowen/GitHub/hexo/s10wen.github.io/node_modules/hexo/node_modules/nunjucks/src/environment.js:374:20)
    at Obj.extend.renderString (/Users/simonowen/GitHub/hexo/s10wen.github.io/node_modules/hexo/node_modules/nunjucks/src/environment.js:261:21)
    at /Users/simonowen/GitHub/hexo/s10wen.github.io/node_modules/hexo/lib/extend/tag.js:56:9
    at tryCatcher (/Users/simonowen/GitHub/hexo/s10wen.github.io/node_modules/hexo/node_modules/bluebird/js/main/util.js:24:31)
    at Promise._resolveFromResolver (/Users/simonowen/GitHub/hexo/s10wen.github.io/node_modules/hexo/node_modules/bluebird/js/main/promise.js:427:31)
    at new Promise (/Users/simonowen/GitHub/hexo/s10wen.github.io/node_modules/hexo/node_modules/bluebird/js/main/promise.js:53:37)
    at Tag.render (/Users/simonowen/GitHub/hexo/s10wen.github.io/node_modules/hexo/lib/extend/tag.js:55:10)
    at Object.tagFilter [as onRenderEnd] (/Users/simonowen/GitHub/hexo/s10wen.github.io/node_modules/hexo/lib/hexo/post.js:253:16)
    at Promise.then.then.then.output (/Users/simonowen/GitHub/hexo/s10wen.github.io/node_modules/hexo/lib/hexo/render.js:55:19)
    at tryCatcher (/Users/simonowen/GitHub/hexo/s10wen.github.io/node_modules/hexo/node_modules/bluebird/js/main/util.js:24:31)
    at Promise._settlePromiseFromHandler (/Users/simonowen/GitHub/hexo/s10wen.github.io/node_modules/hexo/node_modules/bluebird/js/main/promise.js:454:31)
    at Promise._settlePromiseAt (/Users/simonowen/GitHub/hexo/s10wen.github.io/node_modules/hexo/node_modules/bluebird/js/main/promise.js:530:18)
    at Promise._settlePromises (/Users/simonowen/GitHub/hexo/s10wen.github.io/node_modules/hexo/node_modules/bluebird/js/main/promise.js:646:14)
    at Async._drainQueue (/Users/simonowen/GitHub/hexo/s10wen.github.io/node_modules/hexo/node_modules/bluebird/js/main/async.js:177:16)
    at Async._drainQueues (/Users/simonowen/GitHub/hexo/s10wen.github.io/node_modules/hexo/node_modules/bluebird/js/main/async.js:187:10)
    at Async.drainQueues (/Users/simonowen/GitHub/hexo/s10wen.github.io/node_modules/hexo/node_modules/bluebird/js/main/async.js:15:14)
    at process._tickCallback (node.js:415:13)
Gtskk commented 9 years ago

@s10wen I think you should have forgotten the steps:

First, open your _config.yml file and paste the following lines:

# hexo-tag-emojis plugin configuration
emojis:
  image_dir: images/emojis
Then run this command:

hexo emojis install

Please check them.

s10wen commented 9 years ago

I've got 2x _config.yml files, one in the root, one in the theme.

I've tried adding that code and running hexo emojis install but it doesn't run.

I've also tried using the cdn option:

emojis:
  cdn: http://cdn.staticfile.org/emojify.js/0.9.0/emojis

But still nothing :/

Gtskk commented 9 years ago

Add the following codes to _config.yml file in the root.

plugins:
  - hexo-tag-emojis

# hexo-tag-emojis plugin configuration
emojis:
  image_dir: images/emojis

Then run hexo emojis install .

online commented 9 years ago

@Gtskk, hi! Tell me, please, it will work with Hexo v 3.x?

Gtskk commented 9 years ago

Please reference here:Reference

That works for me.

s10wen commented 9 years ago

@Gtskk I've got hexo-tag-emojis there and updated line 1 and added the code to the root _config.yml but where I run hexo emojis install I just get Usage: hexo <command>.

Here's my setup if that helps:

hexo: 3.1.1
os: Darwin 14.4.0 darwin x64
http_parser: 1.0
node: 0.10.24
v8: 3.14.5.9
ares: 1.9.0-DEV
uv: 0.10.21
zlib: 1.2.3
modules: 11
openssl: 1.0.1e
Gtskk commented 9 years ago

@s10wen What you have got means that hexo emojis install didn't register successfully. Now I think you can try one of the following steps: Use the cnd instead of installing the assets Or Re-install the plugin and repeat the steps here

s10wen commented 9 years ago

I've tried the cdn option and also re-installing.

s10wen commented 9 years ago

@Gtskk do you have your hexo repo on here anywhere please? I'm thinking if I can get yours working locally that might help me to figure out what the issue is.

Gtskk commented 9 years ago

@s10wen You can just hexo inita new project, just like creating a new hexo site. Then install the hexo-tag-emojis plugin in the project directory.Finally repeat the steps here

You can check if the errors still occur.

s10wen commented 9 years ago

Hey, @Gtskk you're right, I can confirm with a fresh hexo build your solution works. So now I need to figure out what's breaking it in mine https://github.com/s10wen/s10wen.github.io

Thanks for the help!

s10wen commented 9 years ago

Guess I should leave this issue open until the PR is accepted https://github.com/sergiolepore/hexo-tag-emojis/pull/10

sergiolepore commented 9 years ago

Fixed with #10.

I'll push a new release later today. Thanks!