Home
Support Forums

Netlify does not see my build folder as it is inside a folder in repo

Hey - so I have a repo called “project”. Project is made in react. My build folder’s location is project/project-signup/build

I have been trying to get netlify to reach that build folder and publish the site but the connection cannot be made. Here are my settings:


I was posting the build report but forum does not allow new users to paste the pictures or post the whole log

Hi @mertdeveci5

If you already have a build directory in your repository, you don’t need to build, you simply need to publish. So it looks like you have set the base directory correctly, but that publish directory should read project-signup/build. If you have already built, you don’t need the build command. If you wish to have Netlify build, keep the build command.

If you need further assistance, can you share your git repository.

Thanks for the answer. Yes it works when I deploy my build run locally but I have to run a local every time I make a change and this is not really loyal to continuous integration. I tried having npm run build and CI= npm run build in the command input but I am having the following log error:

1:19:19 PM: ────────────────────────────────────────────────────────────────
1:19:19 PM: 1. Build command from Netlify app
1:19:19 PM: ────────────────────────────────────────────────────────────────
1:19:19 PM: ​
1:19:19 PM: $ npm run build
1:19:19 PM: > mused-signup@0.1.0 build
1:19:19 PM: > craco build
1:19:22 PM: Creating an optimized production build…
1:19:23 PM: Failed to compile.
1:19:23 PM:
1:19:23 PM: ./src/index.js
1:19:23 PM: Cannot find module: ‘react-redux’. Make sure this package is installed.
1:19:23 PM: You can install this package by running: npm install react-redux.
1:19:23 PM: ​
1:19:23 PM: ────────────────────────────────────────────────────────────────
1:19:23 PM: “build.command” failed
1:19:23 PM: ────────────────────────────────────────────────────────────────
1:19:23 PM: ​
1:19:23 PM: Error message
1:19:23 PM: Command failed with exit code 1: npm run build
1:19:23 PM: ​
1:19:23 PM: Error location
1:19:23 PM: In Build command from Netlify app:
1:19:23 PM: npm run build
1:19:23 PM: ​
1:19:23 PM: Resolved config
1:19:23 PM: build:
1:19:23 PM: base: /opt/build/repo/mused-signup
1:19:23 PM: command: npm run build
1:19:23 PM: commandOrigin: ui
1:19:23 PM: publish: /opt/build/repo/mused-signup/build
1:19:23 PM: publishOrigin: ui
1:19:23 PM: redirects:
1:19:24 PM: - from: /*
status: 200
to: /index.html
Caching artifacts
1:19:24 PM: Started saving node modules
1:19:24 PM: Finished saving node modules
1:19:24 PM: Started saving build plugins
1:19:24 PM: Finished saving build plugins
1:19:24 PM: Started saving pip cache
1:19:24 PM: Finished saving pip cache
1:19:24 PM: Started saving emacs cask dependencies
1:19:24 PM: Finished saving emacs cask dependencies
1:19:24 PM: Started saving maven dependencies
1:19:24 PM: Finished saving maven dependencies
1:19:24 PM: Started saving boot dependencies
1:19:24 PM: Finished saving boot dependencies
1:19:24 PM: Started saving rust rustup cache
1:19:24 PM: Finished saving rust rustup cache
1:19:24 PM: Started saving go dependencies
1:19:24 PM: Finished saving go dependencies
1:19:26 PM: Build failed due to a user error: Build script returned non-zero exit code: 2
1:19:26 PM: Creating deploy upload records
1:19:26 PM: Failing build: Failed to build site
1:19:27 PM: Failed during stage ‘building site’: Build script returned non-zero exit code: 2
1:19:27 PM: Finished processing build request in 2m1.76692873s

Happy to share my repository if the problem may be related to the folder structure or something else

Do you have that module in your package.json?

It would always help to share your repo if possible.

it was not. Just added it but having the same problem. Sorry, as the repo belongs to the team and is private, cannot share due to security concerns but would really appreciate any other recommendation you have.

I am trying to add the log again but does not allow it as I am a new user.

Alright, what’s the site name? Not sure if I missed it somewhere in the thread.

Here it is if it is of help: Mused Pay | Creator Banking (dreamy-engelbart-06cdbb.netlify.app)

It appears your site has deployed. Does this mean you have solved your issue @mertdeveci5?

Negative. This is deployed version when I build it locally and load to Netlify. To have CI, I am trying to have a version that would build it on netlify machines.

So what is the issue currently?

Is it still this as per the last log you shared?

Or is there a different issue now?

I installed and put react redux in my package json files. That did not solve the error Netlify generates. The issue simply is that I would like netlify to build the app (npm run build) and deploy.

In this way, I will not need to run build locally and deploy everytime. Instead, I will make changes, deploy to Github and Netlify will run automatically and deploy.

Currently, Netlify is not able to run npm run build. THere is always an error

Is it the same error every time, or a different error each time?

Are your build settings the same as those in your original post? If so, I explained in my initial reply you needed to change the Publish directory as the settings you had meant the directory that was getting built was also the directory that was getting deployed. Did you make this change?

It appears you a unwilling/unable to share your repository. Without the ability to see the repository, and potentially test it, it makes providing a solution to your issue extremely difficult if not impossible.