hexo server not working

Created on 9 Aug 2015  ·  16Comments  ·  Source: hexojs/hexo

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/

Most helpful comment

npm install hexo-server --save

All 16 comments

npm install hexo-server --save

[ [email protected] /srv/node/dumbquot.es-2345 ]$> npm install hexo-server --save
[email protected] node_modules/hexo-server
├── [email protected]
├── [email protected]
├── [email protected]
├── [email protected] ([email protected], [email protected], [email protected], [email protected], [email protected])
├── [email protected]
├── [email protected] ([email protected], [email protected], [email protected], [email protected], [email protected])
├── [email protected] ([email protected], [email protected], [email protected], [email protected])
├── [email protected] ([email protected], [email protected], [email protected], [email protected], [email protected], [email protected])
└── [email protected] ([email protected], [email protected], [email protected])
[ [email protected] /srv/node/dumbquot.es-2345 ]$> 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/

https://github.com/hexojs/hexo/wiki/Migrating-from-2.x-to-3.0

It seems like your are not in a hexo floder

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..

@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.

@LumpyChen Looks like I am having the same case with you. But I haven't found out which sentence yet.

looks like it's the plugins line

@kenspirit
Yep plugins line
The problem is that the plugin line in _config.yml causes hexo-cli to ignore the whole project...

Any solutions?

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

Still having issues.
Adding hexo-server in plugins, the server runs but got a template render error, while removing the whole plugins def in _config.yml everything works as expected.

@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

Same issue here. My hexo version is 3.6.0, and my solution:

step 1:

npm instal hexo-server --save

step 2:

add such lines to _config.yml

plugins:
  - hexo-server

Things will be right then.

If you found your hexo d do not work then, you can solve it by:

step 1:

npm install hexo-deployer-git --save

step 2:

add such lines to _config.yml

plugins:
  - hexo-server
  - hexo-deployer-git

I think such things sould be mentioned in the doc, but actually not now.

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

Worked for me! Thanks a lot

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

it's work for me Thanks.

This problem is caused by wrong "_config.yml", so please check your "_config.yml" find if there are some mistake such like Error indenting code.

Was this page helpful?
0 / 5 - 0 ratings