@RandomUser24 For future reference you should post your entire build log, not just a screenshot. The section that you’ve screenshot is fairly useless and the real error will will be higher up in the log.
Have you tried running your npm run build command locally?
When I do I get the following error:
You’re running react-scripts build but I don’t see react-scripts in your dependencies:
I notice you have another sub-folder with another package.json too, and it’s likely that may be the true source of your issues.
Netlify will only automatically install the dependencies of the package.json file that it finds in your Base directory
Execute the build command in the root of the repository (as you have no Base directory set)
Run the command CI= npm run build
Send the folder client/build to the CDN
Does that seem correct to you?
As I stated originally, Netlify will install the dependencies of the package.json that it finds in your Base directory, which in this case is the root of the repository by default, as you’ve not specified anything else.
That particular package.json doesn’t contain any dependency for react-scripts.
Netlify doesn’t install the dependencies of any of your other package.json files.
It’s then running the npm run build command of that root package.json, which says to run react-scripts build, it then cannot find react-scripts and it errors.
If you want Netlify to install a different package.json or be in a different folder, you need to configure it as such, as I said originally.
I had it before set as Client and before name of the project. I created another repository in order to try it againt differently. GitHub - Markomanis/5 but at this point I do not know unfortunarelly how ti link it properly or which folder should I specify
I understand you sir but I do not know how to do it. I have 2 files package.json one in root dir and one is located in the Client. And this is my issue to be honnest I dont know how to move them or link them in so way that it would be possible to get properly to package.json which is located in the Client folder where are all react-scripts located
I do but I do not know how to configure it in order to be able Netlify to get properly into the package.json that is located in my Client folder where are all my scripts where the command npm run build can actually work
When I run my project offline I do in the main root so I step out of the CLient where my backend is aswell and then I run npm start dev in order to both front end and back end ran properly. So client is not enough that’s I thought it is okay to have 2 package.json files have I cant even imagine how I would have done it with one both front end and back end
@MagicoCoding2 That’s fine for working locally, but the kind of server.js setup that you have won’t work on Netlify, (there’s no runtime node.js), so you would need to run that kind of backend elsewhere or re-engineer it to work with Serverless Functions.
I suspect you could only deploy the frontend/client on Netlify.
That being the case, you could either deploy your project elsewhere that supports your way of working, or deploy just the client to Netlify and the backend elsewhere.
If you do want to deploy the client here, then you need to determine how you can build/deploy it separately, for example if you only need the client folder, you would set the Base directory to client.
Here’s the support article that elaborates on the limitations in case you weren’t aware: