Hexo site cannot be deployed, Installing Hugo?

Hi all! I am trying to deploy a Hexo project using Cloudflare pages and it looks like my first deployment wasn’t successful. I am checking the build logs and it looks like it was installing Hugo instead of Hexo. I am wondering why is this happening and how I can fix it to deploy successfully?
Appreciate any help in advance :smile:

Following are associated Configs and Logs:
Build Configs:

Build command:
hexo generate
Build output directory:
/public
Root directory:
/
Build comments on pull requests:
Enabled

Build log:

|17:12:54.362|Success: Finished cloning repository files|
|---|---|
|17:12:55.019|Installing dependencies|
|17:12:55.030|Python version set to 2.7|
|17:12:58.194|v12.18.0 is already installed.|
|17:12:59.341|Now using node v12.18.0 (npm v6.14.4)|
|17:12:59.554|Started restoring cached build plugins|
|17:12:59.569|Finished restoring cached build plugins|
|17:13:00.042|Attempting ruby version 2.7.1, read from environment|
|17:13:03.425|Using ruby version 2.7.1|
|17:13:03.777|Using PHP version 5.6|
|17:13:03.937|5.2 is already installed.|
|17:13:03.963|Using Swift version 5.2|
|17:13:03.963|Installing Hugo 0.54.0|
|17:13:04.780|Hugo Static Site Generator v0.54.0-B1A82C61A/extended linux/amd64 BuildDate: 2019-02-01T10:04:38Z|
|17:13:04.783|Started restoring cached go cache|
|17:13:04.801|Finished restoring cached go cache|
|17:13:04.932|go version go1.14.4 linux/amd64|
|17:13:04.946|go version go1.14.4 linux/amd64|
|17:13:04.949|Installing missing commands|
|17:13:04.949|Verify run directory|
|17:13:04.950|Executing user command: hexo g|
|17:13:04.954|/opt/build/bin/build: line 39: hexo: command not found|
|17:13:04.959|Failed: build command exited with code: 127|
|17:13:05.771|Failed: an internal error occurred|

Hugo is always currently installed, as well as PHP, Go, Node.js etc. and a bunch of other tooling. You can safely ignore these if you’re not using them.

Do you have a package.json in your repository root with hexo and any other dependencies you need listed? Pages will automatically install anything listed there, but you could also run commands like npm install hexo-cli -g manually in your build command if needed.

If you could share your repo, that would also help a lot for diagnosis.

2 Likes

Thanks a lot for replying! I think it is truly a package.json problem I didn’t notice

1 Like

This topic was automatically closed 3 days after the last reply. New replies are no longer allowed.