Netlify Vite Not found; exit code 127

Does not give me app url/name

Build Logs

11:28:07 PM: Netlify Build
11:28:07 PM: ────────────────────────────────────────────────────────────────
11:28:07 PM: ​
11:28:07 PM: ❯ Version
11:28:07 PM: @netlify/build 29.58.4
11:28:07 PM: ​
11:28:07 PM: ❯ Flags
11:28:07 PM: accountId: 6643ad0dbe2c1621f9c4cc9a
11:28:07 PM: baseRelDir: true
11:28:07 PM: buildId: 678f223e1610ef00084d183f
11:28:07 PM: deployId: 678f223e1610ef00084d1841
11:28:10 PM: ​
11:28:10 PM: ❯ Current directory
11:28:10 PM: /opt/build/repo/client
11:28:10 PM: ​
11:28:10 PM: ❯ Config file
11:28:10 PM: /opt/build/repo/client/netlify.toml
11:28:10 PM: ​
11:28:10 PM: ❯ Context
11:28:10 PM: production
11:28:10 PM: ​
11:28:10 PM: build.command from netlify.toml
11:28:10 PM: ────────────────────────────────────────────────────────────────
11:28:10 PM: ​
11:28:10 PM: $ npm install && npm run build
11:28:11 PM: Failed during stage ‘building site’: Build script returned non-zero exit code: 2 (Search results for '"non-zero exit code: 2"' - Netlify Support Forums)
11:28:11 PM: up to date, audited 2 packages in 504ms
11:28:11 PM: 1 package is looking for funding
11:28:11 PM: run npm fund for details
11:28:11 PM: found 0 vulnerabilities
11:28:11 PM: > client@0.0.1 build
11:28:11 PM: > vite build
11:28:11 PM: sh: 1: vite: not found
11:28:11 PM: ​
11:28:11 PM: “build.command” failed
11:28:11 PM: ────────────────────────────────────────────────────────────────
11:28:11 PM: ​
11:28:11 PM: Error message
11:28:11 PM: Command failed with exit code 127: npm install && npm run build (Search results for '"non-zero exit code: 127"' - Netlify Support Forums)
11:28:11 PM: ​
11:28:11 PM: Error location
11:28:11 PM: In build.command from netlify.toml:
11:28:11 PM: npm install && npm run build
11:28:11 PM: ​
11:28:11 PM: Resolved config
11:28:11 PM: build:
11:28:11 PM: base: /opt/build/repo/client
11:28:11 PM: command: npm install && npm run build
11:28:11 PM: commandOrigin: config
11:28:11 PM: environment:
11:28:11 PM: - NODE_ENV
11:28:11 PM: - NODE_VERSION
11:28:11 PM: publish: /opt/build/repo/client/client/build
11:28:11 PM: publishOrigin: config
11:28:11 PM: Build failed due to a user error: Build script returned non-zero exit code: 2
11:28:11 PM: Failing build: Failed to build site
11:28:12 PM: Finished processing build request in 20.565s

Screen shots of build settings

github repo is https:repo under client directory (mono repo)

I tried changing vite from devDependencies to dependencies in package.json that didn’t change it, I changed from /client to client tried to deploy from CLI that did not work either

tried to reinstall vite multiple times as instructed by chatbot

@Mjishu The link that you’ve provided is to your entire GitHub account, not a specific repository.

I’m guessing that you actually mean this repository?
https://github.com/Mjishu/pokeDate/tree/main/client

It seems you’re using both the Build settings in the UI, and in the netlify.toml

Have you tried just one or the other?

Provided the other settings are correct, I wouldn’t expect you need to run npm install yourself.

I know you mention having tried it, but sometimes the devDependencies aren’t installed, as per the warning on this page:
https://docs.netlify.com/configure-builds/manage-dependencies/#node-js-environment

1 Like

Apologies about the github link. I removed all the build settings from the UI and just used the .toml file with these settings → [build]

publish = “/client/build”

base = “/client”

command = “npm run build”

[context.production.environment]

NODE_VERSION = “22.13.0”

the site now deploys but it looks like its ignoring the base directory build command and just building the entire project?

this is what the “deploy file browser” shows me in my project settings now

pokefinders/
client/
db/
server/
issues.md136 B
qd notification_status1.1 KB
readme.md190 B
todo.md

the url is → site url

if i go to Poke' Find it shows me the default svelte app.html but it doesn’t load the apps? I am guessing this is a svelte issue I need to fix and not an issue on netlify?

@Mjishu See the Base directory documentation here:

https://docs.netlify.com/configure-builds/overview/#set-the-base-directory