Did anyone get Hugo with (private and public) modules to work on Netlify? Neither did I
First the error “fatal: could not read Username for ‘https://github.com’: terminal prompts disabled” came up. I solved that by adding a line to my deploy script:
git config --global --add url."git@github.com:".insteadOf "https://github.com/"
This forces git to use ssh instead of https.
Then the following error pops up:
8:23:49 PM: Host key verification failed.
8:23:49 PM: fatal: Could not read from remote repository.
8:23:49 PM: Please make sure you have the correct access rights
8:23:49 PM: and the repository exists.
on ALL modules, even the public ones. Creating a deploy key on Netlify and adding it on Github does not solve this, but seems to be what everyone is advising.
I finally thought I got “it” working by adding all modules as vendor directory:
hugo mod vendor
But that added only the public modules to the _vendor
directory. One private module is missing.
Long story short, for now I am committing the public directory to publish on Netlify while using modules with Hugo. How are your experiences?