# Deploy did not succeed: Deploy directory ".next" does not exist

**URL:** <https://answers.netlify.com/t/deploy-did-not-succeed-deploy-directory-next-does-not-exist/108148>\
**Category:** Support\
**Tags:** deployment\
**Created:** [December 7, 2023, 11:31pm UTC](https://answers.netlify.com/t/deploy-did-not-succeed-deploy-directory-next-does-not-exist/108148 "2023-12-07T23:31:23Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![kedar9](https://avatars.discourse-cdn.com/v4/letter/k/97f17d/32.png) [@kedar9](https://answers.netlify.com/u/kedar9)\
**Post date:** [December 7, 2023, 11:31pm UTC](https://answers.netlify.com/t/deploy-did-not-succeed-deploy-directory-next-does-not-exist/108148/1 "2023-12-07T23:31:23Z")

</div>

I have a Next JS (+React) app. And I am getting the following error on the “Deploy” stage:  
`Deploy did not succeed: Deploy directory ".next" does not exist`

I was having troubles with the build stage because Netlify was using Node 16. In the process of debugging that error, I referred to a couple of other Netlify answers and had updated my Publish directory value twice.  
One time I updated it to be: `build` and the second time, I updated it to be `out`.  
This was from “Build & Deploy” \> “Continuous deployment” \> “Build settings”.

That error was fixed as I set the Environment Variable `NODE_VERSION` to `18`.

I have since updated the Publish directory value back to `.next` (which I believe is Next’s default publish dir). But I am still getting the following error log:

```auto
4:39:05 PM: Deploy site                                                   
4:39:05 PM: ────────────────────────────────────────────────────────────────
4:39:05 PM: ​
4:39:05 PM: Section completed: deploying
4:39:05 PM: ​
4:39:05 PM: Configuration error                                           
4:39:05 PM: ────────────────────────────────────────────────────────────────
4:39:05 PM: ​
4:39:05 PM: Error message
4:39:05 PM: Deploy did not succeed: Deploy directory ".next" does not exist
4:39:05 PM: ​
4:39:05 PM: Resolved config
4:39:05 PM: build:
4:39:05 PM: environment:
4:39:05 PM: - NETLIFY_NEXT_PLUGIN_SKIP
4:39:05 PM: - NODE_VERSION
4:39:05 PM: publish: /opt/build/repo/.next
4:39:05 PM: publishOrigin: ui
4:39:05 PM: plugins:
4:39:05 PM: - inputs: {}
4:39:05 PM: origin: ui
4:39:05 PM: package: "@netlify/plugin-nextjs"
4:39:05 PM: - inputs: {}
4:39:05 PM: origin: ui
4:39:05 PM: package: "@netlify/plugin-lighthouse"
4:39:06 PM: Failed during stage "building site": Build script returned non-zero exit code: 2
4:39:06 PM: Build failed due to a user error: Build script returned non-zero exit code: 2
4:39:06 PM: Failing build: Failed to build site

```

---

<div class="post-metadata">

**Author:** ![hrishikesh](https://sea1.discourse-cdn.com/netlify/user_avatar/answers.netlify.com/hrishikesh/32/74607_2.png) [@hrishikesh](https://answers.netlify.com/u/hrishikesh)\
**Post date:** [December 8, 2023, 1:00pm UTC](https://answers.netlify.com/t/deploy-did-not-succeed-deploy-directory-next-does-not-exist/108148/2 "2023-12-08T13:00:32Z")

</div>

Without a site name, we can’t check anything.

---

<div class="post-metadata">

**Author:** ![kedar9](https://avatars.discourse-cdn.com/v4/letter/k/97f17d/32.png) [@kedar9](https://answers.netlify.com/u/kedar9)\
**Post date:** [December 8, 2023, 2:52pm UTC](https://answers.netlify.com/t/deploy-did-not-succeed-deploy-directory-next-does-not-exist/108148/3 "2023-12-08T14:52:02Z")

</div>

Site: [https://fontstudio.netlify.app/](https://fontstudio.netlify.app/)

---

<div class="post-metadata">

**Author:** ![hrishikesh](https://sea1.discourse-cdn.com/netlify/user_avatar/answers.netlify.com/hrishikesh/32/74607_2.png) [@hrishikesh](https://answers.netlify.com/u/hrishikesh)\
**Post date:** [December 9, 2023, 6:09pm UTC](https://answers.netlify.com/t/deploy-did-not-succeed-deploy-directory-next-does-not-exist/108148/4 "2023-12-09T18:09:35Z")

</div>

You need to set the build command to `npm run build`: [Build & deploy | Site configuration | fontstudio | Netlify](https://app.netlify.com/sites/fontstudio/configuration/deploys#build-settings)
