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
- update hexo to latest version 3.3.8 The error was met: ``` ERROR Local hexo not found in ... ERROR Try running: 'npm install hexo --save' ``` It's said that it is fixed in latest hexo https://github... — committed to lotabout/lotabout.github.io by lotabout 7 years ago
- update hexo to latest version 3.3.8 The error was met: ``` ERROR Local hexo not found in ... ERROR Try running: 'npm install hexo --save' ``` It's said that it is fixed in latest hexo https://github... — committed to lotabout/lotabout.github.io by lotabout 7 years ago
- update hexo to latest version 3.3.8 The error was met: ``` ERROR Local hexo not found in ... ERROR Try running: 'npm install hexo --save' ``` It's said that it is fixed in latest hexo https://github... — committed to lotabout/lotabout.github.io by lotabout 7 years ago
- update hexo to latest version 3.3.8 The error was met: ``` ERROR Local hexo not found in ... ERROR Try running: 'npm install hexo --save' ``` It's said that it is fixed in latest hexo https://github... — committed to lotabout/lotabout.github.io by lotabout 7 years ago
A solution that worked for me to is removing the node_modules/ directory and reinstall it, so run:
rm -rf node_modules/ && npm installmaybe your Nodejs version is too old. see here
I have the same problem…
npm install -g node-gypdidn’t solve this problem…😦Edit: Everything is fine if I use
hexo initto create a new blog and usehexo serverto run it… but it doesn’t work in the old project folderAfter 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 --savein base directory of blog, this works for me@2016lkaust This is an know issue and will be fixed in next build. Please call
hexocommand with argument, like runhexo initshould be fine. https://github.com/hexojs/hexo/pull/2520@JohannHospice Thanks,it works