ENOENT: no such file or directory, mkdir '/opt/build/repo/website/dist'

Hi there,

I’m trying to deploy a dead simple Nuxt 3 site into netlify.

All it needs to be is a prerendered site - don’t even need any SSR functionality.

No matter what i try on my end, it keeps failing on this build step.

[error] ENOENT: no such file or directory, mkdir '/opt/build/repo/website/dist'
12:08:58 AM: ​
12:08:58 AM: build.command failed                                        
12:08:58 AM: ────────────────────────────────────────────────────────────────
12:08:58 AM: ​
12:08:58 AM:   Error message
12:08:58 AM:   Command failed with exit code 1: npm run deploy (https://ntl.fyi/exit-code-1)
12:08:58 AM: ​
12:08:58 AM:   Error location
12:08:58 AM:   In Build command from Netlify app:
12:08:58 AM:   npm run deploy
12:08:58 AM: ​
12:08:58 AM:   Resolved config
12:08:58 AM:   build:
12:08:58 AM:     base: /opt/build/repo/website
12:08:58 AM:     command: npm run deploy
12:08:58 AM:     commandOrigin: ui
12:08:58 AM:     publish: /opt/build/repo/website/.output/public
12:08:58 AM:     publishOrigin: ui
12:09:00 AM: Build failed due to a user error: Build script returned non-zero exit code: 2
12:09:00 AM: Failing build: Failed to build site
12:09:00 AM: Finished processing build request in 1m14.791s

I am honestly about to rip my hair out.

Has anyone come across these issues before - specifically with nuxt?

Hi, the issue is in the build log. You need to change your build command. Please checkout our docs page for the build command to use when using the Nuxt framework.

Also I recommend you check out support guide below as this helps many people debug their build problems!