I can't deploy any static web apps

2025-02-17T01:58:21.3933333+00:00

I just follow the wizard so everything is done automatically. I select html so there should be no issues with installing anything. No javascript or anything more tricky than strict html. I keep getting errors about stuff not being set up properly. This is confusing because I used the wizard which should have set up everything automatically. If there is supposed to be something called build or build:azure or node or json then the wizard should have set that up. I have no idea what monorepos is.

Error: Could not find either 'build' or 'build:azure' node under 'scripts' in package.json. Could not find value for custom run build command using the environment variable key 'RUN_BUILD_COMMAND'.Could not find tools for building monorepos, no 'lerna.json' or 'lage.config.js' files found.

Azure Static Web Apps
Azure Static Web Apps
An Azure service that provides streamlined full-stack web app development.
1,081 questions
{count} votes

1 answer

Sort by: Most helpful
  1. Siva Nair 395 Reputation points Microsoft Vendor
    2025-02-19T05:01:34.3933333+00:00

    Hi David Matichuk

    To fix the issue, Lets follow these steps:

     1.Since you're only using HTML, you don’t need a build step. But Azure still needs to know where your files are. Try this:

    1. Go to the Azure Static Web Apps deployment settings.
    2. Set the "App location" to "/" (the root folder where your HTML files are).
    3. Set the "Output location" to "/" as well, since there is no separate build output. This should tell Azure to just use your raw HTML files without looking for a build process. 

    2.Even though you don’t need Node.js, Azure might still expect a package.json. If you keep getting errors, try adding a minimal one:

    1. Create a file called package.json in your project’s root folder.
    2. Add this content: {   "scripts": {
          "build": "echo 'No build needed'" }
      }
    3. Push the changes and redeploy.

    3.Make sure you're not using a "Custom Build Command" (it should be blank). Ensure your repository structure is correct. Your HTML files should be directly in the repo, not buried in subfolders.

    If you have any further assistant, do let me know, with few doubts in comment i have mentioned, to assist you better.

    If the answer is helpful, please click Accept Answer and kindly upvote it so that other people who faces similar issue may get benefitted from it.

     

    0 comments No comments

Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.