Deploy error using netlify cMS

Hello,

I am trying to deploy a website on netlify but it shows me an error:

12:35:47 PM: ​
12:35:47 PM: ────────────────────────────────────────────────────────────────
12:35:47 PM: 2. Deploy site
12:35:47 PM: ────────────────────────────────────────────────────────────────
12:35:47 PM: ​
12:35:47 PM: ​
12:35:47 PM: ────────────────────────────────────────────────────────────────
12:35:47 PM: Configuration error
12:35:47 PM: ────────────────────────────────────────────────────────────────
12:35:47 PM: ​
12:35:47 PM: Error message
12:35:47 PM: Deploy did not succeed: Deploy directory ‘build’ does not exist
12:35:47 PM: ​
12:35:47 PM: Resolved config
12:35:47 PM: build:
12:35:47 PM: command: CI= npm run build
12:35:47 PM: commandOrigin: ui
12:35:47 PM: publish: /opt/build/repo/build
12:35:47 PM: Caching artifacts
12:35:47 PM: Started saving node modules
12:35:47 PM: Finished saving node modules
12:35:47 PM: Started saving build plugins
12:35:47 PM: Finished saving build plugins
12:35:47 PM: Started saving pip cache
12:35:47 PM: Finished saving pip cache
12:35:47 PM: Started saving emacs cask dependencies
12:35:47 PM: Finished saving emacs cask dependencies
12:35:47 PM: Started saving maven dependencies
12:35:47 PM: Finished saving maven dependencies
12:35:47 PM: Started saving boot dependencies
12:35:47 PM: Finished saving boot dependencies
12:35:47 PM: Started saving rust rustup cache
12:35:47 PM: Finished saving rust rustup cache
12:35:47 PM: Started saving go dependencies
12:35:47 PM: Finished saving go dependencies
12:35:50 PM: Build failed due to a user error: Build script returned non-zero exit code: 2
12:35:50 PM: Failing build: Failed to build site
12:35:50 PM: Failed during stage ‘building site’: Build script returned non-zero exit code: 2
12:35:50 PM: Finished processing build request in 2m56.897288599s

I tried various ways out but couldn’t find a solution to get off this error. Can anyone help me out with this error?

Thanks in advance.

12:35:47 PM: Deploy did not succeed: Deploy directory ‘build’ does not exist

This error message is found in your log, this means that in the deploy settings in the Netlify UI your publish directory/build command has been set to build and Netlify can’t find a directory named build in your project.
I would just leave these settings blank unless you need to change them to abide by a certain SSG’s configuration

Hello,

I made the changes in the directory build as suggested, build was successful and now it shows : Page Not Found

Looks like you’ve followed a broken link or entered a URL that doesn’t exist on this site.

Back to our site

But the website works well on my local environment.

Thank you,
Achyuth Krishna

Could you link to your git repo?

link to my repo : https://github.com/pdc-uottawa/PDCwebsite/tree/DevCopy_Krishna

Try:

Build Command: npm run build

Publish Directory: /client if that doesn’t work try /client/public

Do you know where to edit these settings?

Hello,
When I tried the build command as npm run build it failed but when I tried it with CI= npm run build it worked, also I used the publish directory: /client/public it is published but the page doesnot show up, nothing when clicked on the link.

Thank you,
Achyuth Krishna

Did you try /client

yes, when tried /client it doesn’t show up either

when tried with /client it shows page not found.

Hi there! Thanks for your interest in Netlify CMS. Looks like you posted your question a little while ago, but that you haven’t received a solution yet. Here’s where you might get more help:

netlifycms.org - the site houses our extensive documentation that likely contains helpful information to get you back on track.

netlify cms slack - join our friendly slack channel and chat with other cms pros to get the help you need.

GitHub Issues - think you’ve found a bug, or would like to make a feature request? Make your voice heard here. Netlify CMS is open source - PRs and other contributions are also welcome!

Stack Overflow Check StackOverflow for questions tagged “Netlify CMS” if you don’t get an answer in the Slack or the GH issues. StackOverflow reaches a worldwide audience of knowledgeable people.

Your question will be left open here for anyone to comment - but we encourage you to check out the above resources if you are still looking for a solution!