dosubot[bot] commented on issue #29825:
URL: https://github.com/apache/superset/issues/29825#issuecomment-2262816294

   <!-- Greeting -->
   Hey there, @bhavik-malhotra! I'm here to help you out with any bugs, 
questions, or contributions while waiting for a human maintainer. Let's tackle 
this together!
   
   <!-- Answer -->
   To resolve the error "failed to solve: process '/bin/sh -c npm run 
${BUILD_CMD}' did not complete successfully: exit code: 1" when running `docker 
compose up` on Mac OS (M3), follow these steps:
   
   1. **Check the Build Command**: Ensure that the `build` script is defined in 
your `package.json` file under the `scripts` section. It should look something 
like this:
   
       ```json
       {
         "scripts": {
           "build": "webpack --config webpack.config.js"
         }
       }
       ```
   
   2. **Verify Dependencies**: Make sure all the necessary dependencies are 
installed correctly. The Dockerfile uses `npm ci` to install dependencies, 
which requires a `package-lock.json` file. Ensure that this file is present and 
up-to-date.
   
   3. **Inspect Logs**: Look at the detailed logs of the `docker compose up` 
command to identify the exact reason for the failure. The logs should provide 
more context on why the `npm run build` command is failing.
   
   4. **Increase Memory**: Sometimes, build processes can fail due to 
insufficient memory. Ensure that Docker has enough memory allocated. You can 
adjust this in Docker Desktop settings.
   
   5. **Run Locally**: Try running the build command locally on your Mac to see 
if it succeeds outside of Docker. This can help identify if the issue is 
specific to the Docker environment.
   
   Additionally, ensure that the `BUILD_CMD` environment variable is correctly 
set. From the provided Dockerfile, the `BUILD_CMD` is set to `"build"` by 
default:
   
   ```dockerfile
   ARG NPM_BUILD_CMD="build"
   ...
   ENV BUILD_CMD=${NPM_BUILD_CMD}
   ```
   
   If the `build` script is missing or incorrect, you can add or update it in 
your `package.json` file. For example:
   
   ```json
   {
     "scripts": {
       "build": "webpack --config webpack.config.js"
     }
   }
   ```
   
   After making these changes, try running `docker compose up` again. If the 
issue persists, inspect the logs for more details on the failure 
<sup>[[1]](https://github.com/apache/superset/blob/master/Dockerfile)</sup>.
   
   
   <!-- Dosu Comment Footer -->
   *To continue talking to [Dosu](https://dosu.dev), mention @dosu.*
   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to