hexo: hexo server not working

hi

i have migrated from a different server installed hexo-cli globally used npm install on the directory but when i try to use hexo server it seems like hexo-cli doesnt know what i mean

bash-4.1$ hexo server
Usage: hexo <command>

Commands:
  help     Get help on Hexo.
  init     Create a new Hexo folder.
  version  Display version information.

Global Options:
  --config  Specify config file instead of using _config.yml
  --cwd     Specify the CWD
  --debug   Display all verbose messages in the terminal
  --safe    Disable all plugins and scripts
  --silent  Hide output on console

For more help, you can use ‘hexo help [command]’ for the detailed information or you can check the docs: http://hexo.io/docs/

About this issue

  • Original URL
  • State: closed
  • Created 9 years ago
  • Reactions: 4
  • Comments: 16 (4 by maintainers)

Most upvoted comments

npm install hexo-server --save

In hexo _config.yml , hexo-server must be included if uncomment the parameter plugins . Hexo server is considered as a plugin

plugins:
- hexo-server
- any-other-plugin

@philippkeller +1 I think it’s not simple path problem, Since I ran the binary file directly from the project node_modules and got the same consequence.

Finally I find it out that it’s the extra plugin setting in _config.yml causing the hexo server to ignore the my project. The server command runs correctly as long as I delete that sentence in _config.yml.

I really think this confusing problem worth fixing, since the bug runs without any error message provided.

@abusedmedia @xiaohk @philippkeller

Here is the bullet.

Step 1, make sure package.json has the following:

{
  "hexo": {
    "version": "3.6.0"
  }
}

Step 2, add hexo-server into plugins

plugins:
  - hexo-server

This is the way you create the folder(empty or not) yourself without hexo-cli

looks like it’s the plugins line

I have the same problem. I did everything in https://github.com/hexojs/hexo/wiki/Migrating-from-2.x-to-3.0 and I even did a complete uninstall:

for package in `ls node_modules`; do npm uninstall $package; done;

but when I run hexo server I see the same output as @RackerJack

Edit: I needed to start afresh with hexo init and then copied all config and themes over and then it worked…