Netlify deploy : error :Failed during stage "building site": Build script returned non-zero exit code: 2

143 Views Asked by At

I have a problem with my site during the built phase on Netlify. Before I was able to publish a site and now I wanted to update it. The code worked fine locally on R markdown. Then I imported the new code on github and I tried to update my site on netlify but it gave me this error. I've been looking for help for 2 weeks. Please help. The deposit is on my github account: https://github.com/BOUGHANMIChaima/blogdown/tree/main/assets Error below :

5:32:04 PM: Netlify Build                                                 
5:32:04 PM: ────────────────────────────────────────────────────────────────
5:32:04 PM: ​
5:32:04 PM: ❯ Version
5:32:04 PM:   @netlify/build 29.27.0
5:32:04 PM: ​
5:32:04 PM: ❯ Flags
5:32:04 PM:   baseRelDir: true
5:32:04 PM:   buildId: 655cdb7746bc030de1a8927e
5:32:04 PM:   deployId: 655cdb7746bc030de1a89280
5:32:04 PM: ​
5:32:04 PM: ❯ Current directory
5:32:04 PM:   /opt/build/repo
5:32:04 PM: ​
5:32:04 PM: ❯ Config file
5:32:04 PM:   /opt/build/repo/netlify.toml
5:32:04 PM: ​
5:32:04 PM: ❯ Context
5:32:04 PM:   production
5:32:04 PM: ​
5:32:04 PM: build.command from netlify.toml                               
5:32:04 PM: ────────────────────────────────────────────────────────────────
5:32:04 PM: ​
5:32:04 PM: $ hugo --gc --minify
5:32:04 PM: Start building sites …
5:32:04 PM: hugo v0.120.4-f11bca5fec2ebb3a02727fb2a5cfb08da96fd9df+extended linux/amd64 BuildDate=2023-11-08T11:18:07Z VendorInfo=gohugoio
5:32:05 PM: Failed during stage "building site": Build script returned non-zero exit code: 2
5:32:05 PM: ERROR Could not find an author page at `/authors/admin`. Please check the value of `author` in your About widget and create an associated author page if one does not already exist. See https://wowchemy.com/docs/page-builder/#about
5:32:05 PM: Total in 522 ms
5:32:05 PM: Error: error building site: logged 1 error(s)
5:32:05 PM: ​
5:32:05 PM: "build.command" failed                                        
5:32:05 PM: ────────────────────────────────────────────────────────────────
5:32:05 PM: ​
5:32:05 PM:   Error message
5:32:05 PM:   Command failed with exit code 1: hugo --gc --minify
5:32:05 PM: ​
5:32:05 PM:   Error location
5:32:05 PM:   In build.command from netlify.toml:
5:32:05 PM:   hugo --gc --minify
5:32:05 PM: ​
5:32:05 PM:   Resolved config
5:32:05 PM:   build:
5:32:05 PM:     command: hugo --gc --minify
5:32:05 PM:     commandOrigin: config
5:32:05 PM:     environment:
5:32:05 PM:       - HUGO_VERSION
5:32:05 PM:       - HUGO_ENV
5:32:05 PM:       - HUGO_ENABLEGITINFO
5:32:05 PM:     publish: /opt/build/repo/public
5:32:05 PM:     publishOrigin: config
5:32:05 PM:   headers:
5:32:05 PM:     - for: /*
      values:
        Permissions-Policy: accelerometer=(), camera=(), geolocation=(), gyroscope=(), magnetometer=(), microphone=(), payment=(), usb=()
        Referrer-Policy: strict-origin-when-cross-origin
        Strict-Transport-Security: max-age=31536000; includeSubDomains
        X-Content-Type-Options: nosniff
        X-XSS-Protection: 1; mode=block
    - for: /index.webmanifest
      values:
        Content-Type: application/manifest+json
    - for: /index.xml
      values:
        Content-Type: application/rss+xml
5:32:05 PM: Build failed due to a user error: Build script returned non-zero exit code: 2
5:32:05 PM: Failing build: Failed to build site
5:32:06 PM: Finished processing build request in 13.137s
0

There are 0 best solutions below