I checked the relative errors and answers from the community: but did not help. the error is exit code 127: Build script returned non-zero exit code: 2

I checked the relative errors and answers from the community but it did not exactly match ith the erroe I am getting. I am really frustrated, because I am new to coding. However I successfully build the site and publish it the last time. This time I just updated the infos in my site and I got this error which I dont get because al the other packages were intact. Heres is the log
5:01:07 PM: Netlify Build

5:01:07 PM: ────────────────────────────────────────────────────────────────

5:01:07 PM:

5:01:07 PM: ❯ Version

5:01:07 PM: @netlify/build 35.5.14

5:01:07 PM:

5:01:07 PM: ❯ Flags

5:01:07 PM: accountId: 6925040bd4a1d929c0a592a7

5:01:07 PM: baseRelDir: true

5:01:07 PM: buildId: 6983511684df1d84f3f9f081

5:01:07 PM: deployId: 6983511684df1d84f3f9f083

5:01:08 PM:

5:01:08 PM: ❯ Current directory

5:01:08 PM: /opt/build/repo

5:01:08 PM:

5:01:08 PM: ❯ Config file

5:01:08 PM: No config file was defined: using default values.

5:01:08 PM:

5:01:08 PM: ❯ Context

5:01:08 PM: production

5:01:08 PM:

5:01:08 PM: Build command from Netlify app

5:01:08 PM: ────────────────────────────────────────────────────────────────

5:01:08 PM: ​

5:01:08 PM: $ npm run build

5:01:08 PM: > web_page@1.0.0 build

5:01:08 PM: > vite build

5:01:08 PM: sh: 1: vite: Permission denied

5:01:08 PM:

5:01:08 PM: “build.command” failed

5:01:08 PM: ────────────────────────────────────────────────────────────────

5:01:08 PM: ​

5:01:08 PM: Error message

5:01:08 PM: Command failed with exit code 127: npm run build (https://ntl.fyi/exit-code-127)

5:01:08 PM: ​

5:01:08 PM: Error location

5:01:08 PM: In Build command from Netlify app:

5:01:08 PM: npm run build

5:01:08 PM: ​

5:01:08 PM: Resolved config

5:01:08 PM: build:

5:01:08 PM: command: npm run build

5:01:08 PM: commandOrigin: ui

5:01:08 PM: publish: /opt/build/repo/build

5:01:08 PM: publishOrigin: ui

5:01:08 PM: Build failed due to a user error: Build script returned non-zero exit code: 2

5:01:08 PM: Failing build: Failed to build site

5:01:08 PM: Finished processing build request in 14.098s

5:01:08 PM: Failed during stage ‘building site’: Build script returned non-zero exit code: 2 (https://ntl.fyi/exit-code-2)

I checked publish directory and my vite configs, theres no mismatch

Hello! Have you checked out the new error reference docs here?

Thank you for your reply. I have checked, but without success. Nothing works. sam error.

Two more things to check.

  1. Are you using AI or our deploy troubleshooting bot? Fix a failed deploy | Netlify Docs
  2. Have you checked your build settings? Build configuration overview | Netlify Docs Confirm you have a build command for your project.

Hey @Sunnet :wave:,
Thanks for reaching out!

We’ve gone ahead and created a support ticket for you, so our team can follow up with you directly via email from the help desk. Our Support crew will be in touch with you by email soon.

Great news: these days anyone can reach out to Netlify Support. First, you can try getting an answer using Ask Netlify, our helpful AI search tool. If your question isn’t answered there, you can submit a ticket using the support form, and we’ll take it from there.

We’re keeping the community around for swapping ideas, sharing tips and tricks, and talking shop with other folks building on the platform — but for support issues, tickets are the way to go.

Thanks for being here, and keep an eye out for that email from us!