Build failure while initializing

I am trying to build my site on Netlify for the first time. I am receiving this error: “Base directory does not exist: /opt/build/repo/web”. The site builds fine on my local machine. My site is made with Typescript and Gatsby. The AI Chatbot said to create a base directory ‘opt/build’ in the project. I don’t agree with this because I have other sites that build fine that don’t have a ‘opt/build’ directory. My build settings are as follows:

Runtime: Not set
Base directory: web
Package directory: Not set
Build command: npm run build
Publish directory: web/public
Functions directory: web/netlify/functions
Build status: Active

Site name: careers-redesign
Deploy Log: Netlify App

Thank you in advance.

Hi, would you mind sharing your repo?

That’s a staggeringly wrong instruction, what a high tech way of sending people on a wild goose chase.

The issue is that your Base directory is set to web and that does not exist when Netlify tries to access it.

You could confirm this by looking at your repository and confirming there is a web directory at the root.

You likely just need to change your Build configuration to be what you actually need, as there are clearly parts of it that are wrong, and it may mean other parts are wrong.

For example the Publish directory is relative to the Base directory, (as explained in the documentation) so the Publish directory of web/public would be /web/web/public and that’s unlikely to exist.

As @SamO has requested, being able to see what’s in your repo would be the fastest way for someone else to guide you as to what your Build configuration should be.

1 Like

Thank you, Nathan! I was easily able to fix it with your direction. I appreciate the help.

That’s great. Thanks for sharing you found a solution. :+1:t6: