hexo: ERROR Local hexo not found

I am unable to run the hexo command inside a hexo blog directory.

dsaltares@saltares:/home/dsaltares/hexo_blog: hexo
ERROR Local hexo not found in ~/hexo_blog
ERROR Try running: 'npm install hexo --save'

The --save option does nothing really.

However I did install hero-cli and hero-server using npm install -g.

I am using nvm to manage node versions.

dsaltares@saltares:/home/dsaltares/hexo_blog: nvm --version
0.31.4
dsaltares@saltares:/home/dsaltares/hexo_blog: node -v
v6.3.1
dsaltares@saltares:/home/dsaltares/hexo_blog: npm --v
3.10.3

The same also happens with node 4 and node 5.

About this issue

  • Original URL
  • State: closed
  • Created 8 years ago
  • Reactions: 8
  • Comments: 46 (5 by maintainers)

Commits related to this issue

Most upvoted comments

A solution that worked for me to is removing the node_modules/ directory and reinstall it, so run: rm -rf node_modules/ && npm install

maybe your Nodejs version is too old. see here

I have the same problem… npm install -g node-gyp didn’t solve this problem…😦

Edit: Everything is fine if I use hexo init to create a new blog and use hexo server to run it… but it doesn’t work in the old project folder

After reinstalling npm using nvm install stable, and again using the method of @JohannHospice, rm -rf node_modules/ && npm install.

I fixed my error. Hope it works.

upgrade nodejs works for me.

run npm install hexo --save in base directory of blog, this works for me

@2016lkaust This is an know issue and will be fixed in next build. Please call hexo command with argument, like run hexo init should be fine. https://github.com/hexojs/hexo/pull/2520

@JohannHospice Thanks,it works