Netlify Build Error - Missing package.json File

Hello, thank you very much for your time and helping me. I am attempting to deploy a SPA done using React. My build continues to fail because the netlify build process cannot locate my package.json. I think the problem is my build settings so I would be extremely grateful if you could take a look and correct my settings for me. Thank you really.

Here is the github: https://github.com/MagentaSpruce/war

My project is war/mort/mort. I wanted to show a picture but apparently new users can only embed one thing per post so I will attempt to post the image in the reply.

I am trying to use these settings to do the build - I have tried various combinations and none of worked. He is one example:

Now whenever I run the deploy, I always get the same error shown here:
Again, I was going to put the image but I can only embed one so I will try below but if I copy and paste from my cmd console then it I get this:

npm ERR! code ENOENT

11:58:13 AM: npm ERR! syscall open

11:58:13 AM: npm ERR! path /opt/build/repo/mort/package.json

11:58:13 AM: npm ERR! errno -2

11:58:13 AM: npm ERR! enoent ENOENT: no such file or directory, open '/opt/build/repo/mort/package.json'

11:58:13 AM: npm ERR! enoent This is related to npm not being able to find a file.

11:58:13 AM: npm ERR! enoent

11:58:13 AM: npm ERR! A complete log of this run can be found in:

11:58:13 AM: npm ERR! /opt/buildhome/.npm/_logs/2022-02-14T17_58_13_237Z-debug-0.log

Would someone help me to make this deployment work? I very much want to know why nothing I am doing is working. I have tried mort/build mort/mort/build mort/ mort/mort/ and others. Same error. Please help. Thank you.

Triss

Here is a picture of my file directory:

Thank you again!

Hi @Triss

Looking at the repository and the screenshot above, the base directory is mort/mort not mort. The publish directory of mort/mort/build is correct though.

Taking the project root as war if you drag everything inside mort/mort into the root so rather than war/mort/mort/public, war/mort/mort/src, etc. you have war/public, war/src, the base directory would then remain blank and the publish directory set to build.

Hey Cole,

I just want you to know you helped to get live a website dedicated to freeing an innocent young woman from Thai prison. Heavy stuff I know, but nevertheless, you have made it possible for her story to now begin to reach the world.

I hope you have a most lovely day and thank you ever so much for the quickness of your response.

Best regards,
Tristan Nettles

2 Likes