netlify deployment: Failed during stage ‘building site’: Build script returned non-zero exit code: 2

I found the same error when trying to deploy my single-page React JS web applications to Netlify.

Following is the procedure I followed to solve the issue and successfully deploy the site.

  1. Go to Site Settings.

    Site Settings

  2. Select Build & Deploy dropdown from the menu.

  3. Select Continuous Deployment tab from the dropdown.

  4. Under the section Build Settings, Select Edit settings.

    • Change the build command as
      CI= npm run build
    • Click Save.

    Build Settings

  5. Then select Environment tab from the dropdown.

    • Select Edit variables.
    • As the Key enter CI and, as the value enter false.
    • Click Save.

    Environment Settings

  6. Finally retrying the deploying the site again.

This will help you to solve the issue related to hosting ‘Rect JS’ Applications in Netlify & your application will be deployed successfully.

Leave a Comment

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)