Hi,
I am pretty new to Netlify. I have a project connected to a git repo where I have both my Strapi backend and my gatsby frontend.
I would like to try out netylify-cli. In the root of my project I have the folders backend and frontend. In the frontend I have a gatsby project. To use netlify-cli, and use GIT as my CI, I cd into my frontend folder and try:
netlify login
netlify init
When prompted I set a site name, and then I am prompted for a build command, so I run the:
gatsby build
command
And when prompted Directory to deploy, I supply
public/
But the build fails as it complains on my gatsby build
and I get the following error:
1:01:42 AM: ┌───────────────────────────────────┐
1:01:42 AM: │ 1. Build command from Netlify app │
1:01:42 AM: └───────────────────────────────────┘
1:01:42 AM:
1:01:42 AM: $ gatsby build
1:01:42 AM: bash: gatsby: command not found
1:01:42 AM:
1:01:42 AM: ┌─────────────────────────────┐
1:01:42 AM: │ “build.command” failed │
1:01:42 AM: └─────────────────────────────┘
1:01:42 AM:
1:01:42 AM: Error message
1:01:42 AM: Command failed with exit code 127: gatsby build
1:01:42 AM:
1:01:42 AM: Error location
1:01:42 AM: In Build command from Netlify app:
1:01:42 AM: gatsby build
1:01:42 AM:
1:01:42 AM: Resolved config
1:01:42 AM: build:
1:01:42 AM: command: gatsby build
1:01:42 AM: commandOrigin: ui
1:01:42 AM: publish: /opt/build/repo/public
I tried to follow the instructions on the gatsby docs
I tried also the instructions on this netlify docs page to do it via the netlify gui, but getting the same error for the gatsby build
command failing.
What am I missing or done incorrectly?
Thanks