Build fails Error: Error building site: No source directory found, expecting to find it at /opt/build/repo/content


#1

Complete noob here, at your mercy. Here is my log file error from netlify

1:14:10 PM: INFO: 2017/03/06 21:14:10 hugo.go:405: Using config file: /opt/build/repo/config.toml
WARN: 2017/03/06 21:14:10 hugo.go:489: No theme set
INFO: 2017/03/06 21:14:10 hugo.go:513: /opt/build/repo/static/ is the only static directory available to sync from
INFO: 2017/03/06 21:14:10 hugo.go:551: syncing static files to /opt/build/repo/public/
1:14:10 PM: Started building sites …
1:14:10 PM: Error: Error building site: No source directory found, expecting to find it at /opt/build/repo/content
1:14:10 PM:
1:14:10 PM: npm
1:14:10 PM:
1:14:10 PM: ERR!
1:14:10 PM: Linux 3.19.0-66-generic
1:14:11 PM: Cleaning up docker container
1:14:10 PM: npm
1:14:12 PM:
1:14:12 PM: ERR!
1:14:12 PM: argv
1:14:12 PM: “/opt/buildhome/.nvm/versions/node/v6.10.0/bin/node” “/opt/buildhome/.nvm/versions/node/v6.10.0/bin/npm” “run” "build"
npm
1:14:12 PM: ERR!
1:14:12 PM: node
1:14:12 PM: v6.10.0
1:14:13 PM: npm
1:14:13 PM: ERR!
1:14:13 PM:
1:14:13 PM: npm v3.10.10
npm
1:14:13 PM: Error running command: Build script returned non-zero exit code: 1
1:14:13 PM: ERR!
1:14:13 PM: code
1:14:13 PM: ELIFECYCLE
1:14:12 PM: Error running command: Build script returned non-zero exit code: 1
1:14:13 PM: npm ERR!
1:14:13 PM: andreagriffiths11.me@1.0.0 build: rm -rf public && hugo && gulp
npm
1:14:13 PM: ERR!
1:14:13 PM: Exit status 255
1:14:13 PM: npm ERR!
1:14:13 PM:
npm
1:14:13 PM: ERR! Failed at the andreagriffiths11.me@1.0.0 build script ‘rm -rf public && hugo && gulp’.
1:14:13 PM: npm ERR!
1:14:13 PM: Finished processing build request
1:14:13 PM: Make sure you have the latest version of node.js and npm installed.
npm ERR!
1:14:13 PM: If you do, this is most likely a problem with the andreagriffiths11.me package,
npm
1:14:13 PM: ERR! not with npm itself.
1:14:13 PM: npm ERR!
1:14:14 PM: Tell the author that this fails on your system:
npm
1:14:14 PM: ERR! rm -rf public && hugo && gulp
npm
1:14:14 PM: ERR!
1:14:14 PM: You can get information on how to open an issue for this project with:
npm ERR!
1:14:14 PM: npm bugs andreagriffiths11.me
npm
1:14:14 PM: ERR!
1:14:14 PM: Or if that isn’t available, you can get their info via:
npm
1:14:14 PM: ERR!
1:14:14 PM: npm owner ls andreagriffiths11.me
npm ERR!
1:14:14 PM: There is likely additional logging output above.
1:14:14 PM:
1:14:14 PM: npm
1:14:14 PM: ERR!
1:14:14 PM: Please include the following file with any support request:
1:14:14 PM: npm
1:14:14 PM: ERR! /opt/build/repo/npm-debug.log
1:14:14 PM: Cached NPM modules


#2

This is just a hunch, but are you using the Victor Hugo theme by chance and trying to host this on Netlify?

I ask because of gulp and the NPM-related errors, which have nothing to do with Hugo. :smile:


#3

thanks for replying @rdwatters I’m actually using this theme https://github.com/christianmendoza/hugo-smpl-theme, more like a fork of his website as is beautiful!


#4

Do you have your theme set in themes in your configuration file? Do you have a content directory in your project root?


#5

I had a similar issue, I was able to build and serve locally on my machine using a docker image with hugo 0.32 running inside of it.

But when I was trying to deploy on Netlify I faced this error message. Debugging with help from Chris from Netlify I created a new empty and draft page inside my content folder, after it I was able to deploy with no errors.


#6

thanks a lot for your shared experience
I had the same issue
and resolve it in the same way :wink: