@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
Make sure that your Basic build settings are set correctly, that you’re pointing Netlify to the right Base directory, and have the right Publish directory set etc.
Well thank you for not helping me sir. Then I go and ask for refund. My project wokrs perfectly to the point when I try to deploy it to your server and it is my fault. Ok.
@RandomUser24 You can be angry at me, but it’s worth noting that I don’t work for Netlify, I’m just a member of the community.
I’ve tried to help you with your issue, but you seem to expect me to configure it for you?
If you want the assistance of Netlify staff you’ll have to wait, and if you’re on a paid plan you can submit a support ticket and wait for assistance there.
I’ve pulled your repository as linked, and executed it locally and that’s not the case.
If you do an npm install (in your root folder) and then do an npm run build (in your root folder), you’ll see the same thing as you’re seeing on Netlify.
If you’re expecting Netlify to go into the client folder and build/deploy that, then you need to configure Netlify to do so, by using the Basic build settings that I’ve linked to.
@RandomUser24 Excellent, that’d be useful instead of just asserting that I’m not trying to help you.
You seem to be angry that I can’t/won’t go into your build settings and set up your project for you, but as I say, there’s a limit to the support that you get here.
You shouldn’t be angry at a community that is trying to help you.
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: