New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ERROR Local hexo not found #2076

Closed
saltares opened this Issue Aug 2, 2016 · 40 comments

Comments

@saltares

saltares commented Aug 2, 2016

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.

@junbaor

This comment has been minimized.

junbaor commented Sep 3, 2016

I have the same problem.

git version 1.9.1
node version v4.5.0
npm version 2.15.9
@ishu3101

This comment has been minimized.

ishu3101 commented Sep 16, 2016

I'm having the same problem on windows as well.

Windows 10
git version: 2.9.0
node version: v6.6.0
npm version: 3.10.3
@yudianguo

This comment has been minimized.

yudianguo commented Sep 18, 2016

vagrant
i have the same problem on vagrant

@NoahDragon

This comment has been minimized.

Member

NoahDragon commented Sep 19, 2016

Same here.

@KIDJourney

This comment has been minimized.

KIDJourney commented Oct 24, 2016

Same here

@vectorzeng

This comment has been minimized.

vectorzeng commented Oct 26, 2016

same here

@NoahDragon

This comment has been minimized.

Member

NoahDragon commented Oct 26, 2016

I don't know the reason, but somehow my config is working now.

@noinfo

This comment has been minimized.

noinfo commented Oct 30, 2016

Same here. Just installed a plugin and updated to the latest hexo version and hexo stopped working. It ran all day without a hitch, plugin install (hexo-tag-googlemaps) and its "gone". Plugin uninstall did not change anything - keeps being broken.

○ → hexo serve ERROR Local hexo not found in unicante-hexo ERROR Try running: 'npm install hexo --save'

Update

I restored my hexo folder from a time machine backup on my mac. Hexo works again. Must have been something that happened when I did the npm install

@Shane24

This comment has been minimized.

Shane24 commented Nov 17, 2016

Any fix for this? Am having the same issue

@NoahDragon

This comment has been minimized.

Member

NoahDragon commented Nov 17, 2016

@Shane24 I have this issue before, but somehow reinstall the npm environment, the issue is gone. No ideas how exactly to fix this.

@ovasquez

This comment has been minimized.

ovasquez commented Nov 25, 2016

Update I created another website with hexo init site2, removed my original site and cloned it again and this time hexo generate worked, not sure what happened though.

I'm having this exact error after a successful install of node-gyp.
For example: hexo generate on a previously existing website throws the same error:

ERROR Local hexo not found in ~\hexo\site
ERROR Try running: 'npm install hexo --save'

But I can successfully use hexo init with a new folder and then use hexo [command] inside the created folder.

@zimplexing

This comment has been minimized.

zimplexing commented Dec 11, 2016

i fixed it,and i reinstall the npm install -g node-gyp you can have a try

@bucketzxm

This comment has been minimized.

bucketzxm commented Jan 4, 2017

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

@Code2Life

This comment has been minimized.

Code2Life commented Jan 10, 2017

Same here...

@oikewll

This comment has been minimized.

oikewll commented Jan 16, 2017

same here

1 similar comment
@2lei

This comment has been minimized.

2lei commented Jan 18, 2017

same here

@aimer1124

This comment has been minimized.

@cbellei

This comment has been minimized.

cbellei commented Jan 18, 2017

I had the same problem. For me even starting a fresh blog through hexo init would give this "Local hexo not found" error message.

What worked for me: I uninstalled and then reinstalled node.js through homebrew and now things are working again. Go figure...

@JohannHospice

This comment has been minimized.

JohannHospice commented Jan 18, 2017

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

@aimer1124

This comment has been minimized.

aimer1124 commented Jan 19, 2017

Thanks @JohannHospice @cbellei .
According @JohannHospice solution, my steps are below:

  1. delete the cache,change travis file
  2. hexo clean, hexo generate . Everything goes well
  3. Add the cache again, It still goes well. Add the cache in travis file
@zjien

This comment has been minimized.

zjien commented Feb 12, 2017

@JohannHospice Thanks,it works

1 similar comment
@iwiilbeback

This comment has been minimized.

iwiilbeback commented Feb 14, 2017

@JohannHospice Thanks,it works

@flyer88

This comment has been minimized.

flyer88 commented Apr 1, 2017

@JohannHospice Thanks,it works!!

@NoahDragon

This comment has been minimized.

Member

NoahDragon commented Apr 2, 2017

Close this issue, as @JohannHospice provided the solution.

@NoahDragon NoahDragon closed this Apr 2, 2017

davidroberts63 added a commit to davidroberts63/okcsharp-website that referenced this issue Apr 12, 2017

@2016lkaust

This comment has been minimized.

2016lkaust commented Apr 19, 2017

I have tried as JohannHospice said,but it seems that it doesn't work.
(I attemped to upload a screenshot,but failed)

LOOK@PC-2015 MINGW64 /e/blog/2016lkaust.github.io
$ npm install
npm WARN deprecated swig@1.4.2: This package is no longer maintained
npm WARN prefer global marked@0.3.6 should be installed with -g

> dtrace-provider@0.8.1 install E:\blog\2016lkaust.github.io\node_modules\dtrace-provider
> node scripts/install.js

LOOK@PC-2015 MINGW64 /e/blog/2016lkaust.github.io
$ hexo
ERROR Local hexo not found in E:\blog\2016lkaust.github.io
ERROR Try running: 'npm install hexo --save'

LOOK@PC-2015 MINGW64 /e/blog/2016lkaust.github.io
$
@NoahDragon

This comment has been minimized.

Member

NoahDragon commented Apr 19, 2017

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

lotabout added a commit to lotabout/lotabout.github.io that referenced this issue Aug 2, 2017

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
hexojs/hexo#2076

lotabout added a commit to lotabout/lotabout.github.io that referenced this issue Aug 2, 2017

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
hexojs/hexo#2076

lotabout added a commit to lotabout/lotabout.github.io that referenced this issue Aug 2, 2017

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
hexojs/hexo#2076

lotabout added a commit to lotabout/lotabout.github.io that referenced this issue Aug 2, 2017

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
hexojs/hexo#2076
@lc1838228782

This comment has been minimized.

lc1838228782 commented Sep 25, 2017

@Spike-Leung

This comment has been minimized.

Spike-Leung commented Oct 13, 2017

@JohannHospice thanks a lot . i meet this error after installed hexo-migrator-rss plugin. may be there something wrong

@haodongguo520

This comment has been minimized.

haodongguo520 commented Feb 12, 2018

same here

@xpgeng

This comment has been minimized.

xpgeng commented Mar 11, 2018

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.

@yushengyuan1993

This comment has been minimized.

yushengyuan1993 commented Apr 3, 2018

@JohannHospice nice and thx!

@Anakinliu

This comment has been minimized.

Anakinliu commented Apr 9, 2018

maybe your Nodejs version is too old.
see here

@dev518

This comment has been minimized.

dev518 commented Apr 9, 2018

@xpgeng resolved as you said
nvm install stable and sudo npm install -g hexo

@bobliaos

This comment has been minimized.

bobliaos commented Apr 22, 2018

@Anakinliu reinstalled Nodejs,then it worked,thx!

erwai pushed a commit to erwai/erwai.github.io that referenced this issue May 31, 2018

erwai added a commit to erwai/erwai.github.io that referenced this issue May 31, 2018

@TinyCalf

This comment has been minimized.

TinyCalf commented Jun 29, 2018

@xpgeng -rf node_modules/ && npm install this works in my situation

@changwei0708

This comment has been minimized.

changwei0708 commented Aug 6, 2018

maker

@changwei0708

This comment has been minimized.

changwei0708 commented Aug 6, 2018

to all , update nodejs to latest version and exec rm -rf node_modules/ && nam install ,it work for me !

@changwei0708

This comment has been minimized.

changwei0708 commented Aug 6, 2018

mac os update nodejs
Here's how I successfully upgraded from v0.8.18 to v0.10.20 without any other requirements like brew etc, (type these commands in terminal):

sudo npm cache clean -f (force) clear you npm cache
sudo npm install -g n install "n" (this might take a while)
sudo n stable upgrade to lastest version
Note that sudo might prompt your password.

If the version number doesn't show up when typing node -v, you might have to reboot.

these instructions are found here as well: davidwalsh.name/upgrade-nodejs

@jnuhwb

This comment has been minimized.

jnuhwb commented Aug 18, 2018

upgrade nodejs works for me.

@xmuyoucai

This comment has been minimized.

xmuyoucai commented Sep 18, 2018

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment