Reputation: 109
Netlify is supposed to be amazing for depoying a gatsby site but having issues such as "Gatsby command not found" when this is the default. Tried changing to just "BUILD" since this is my package.json script but still nothing... any thoughts?
Upvotes: 1
Views: 350
Reputation: 1
Romeo is right, but you have to install gatsby-cli locally (npm i gatsby-cli
), so that it appears in the package.json file, and saved to Git.
(npm i -global gatsby-cli
will probably fail, because that will not record the dependency in the package.json file.)
That way, when the netlify build process uses the package.json file to build the package, gatsby-cli is in there, and the "gatsby build" command will be available.
Upvotes: 0
Reputation: 10252
The docs at Gatsby instruct you to install the cli globally: npm install --global gatsby-cli
. This probably results in a missing dependency in production, hence the gatsby command not found
error.
In short, make sure gatsby
is part of your dependencies inside package.json
Upvotes: 1