# "Error: No such directory" Did you forget › to run a build? after netlify deploy --prod

**URL:** <https://answers.netlify.com/t/error-no-such-directory-did-you-forget-to-run-a-build-after-netlify-deploy-prod/55344>\
**Category:** Support\
**Tags:** building, deployment\
**Created:** [April 22, 2022, 4:37pm UTC](https://answers.netlify.com/t/error-no-such-directory-did-you-forget-to-run-a-build-after-netlify-deploy-prod/55344 "2022-04-22T16:37:18Z")\
**Posts on this page:** 7\
**Page:** 1

<div class="post-metadata">

**Author:** ![oosp](https://avatars.discourse-cdn.com/v4/letter/o/f08c70/32.png) [@oosp](https://answers.netlify.com/u/oosp)\
**Post date:** [April 22, 2022, 4:37pm UTC](https://answers.netlify.com/t/error-no-such-directory-did-you-forget-to-run-a-build-after-netlify-deploy-prod/55344/1 "2022-04-22T16:37:19Z")

</div>

I am having an issue in finalising the deployment after netlify deploy --prod. I tried to run npm run build but it doesn’t work.  
Then it suggest to do this:  
Please provide a publish directory (e.g. “public” or “dist” or “.”):  
I tried the 3 options, the third one went through and what I get is a black rotten app:

> **[Ornella Spada](https://ornellaspada.netlify.app/)**
>
> Web site created using create-react-app

---

<div class="post-metadata">

**Author:** ![hillary](https://sea1.discourse-cdn.com/netlify/user_avatar/answers.netlify.com/hillary/32/21132_2.png) [@hillary](https://answers.netlify.com/u/hillary)\
**Post date:** [April 22, 2022, 9:02pm UTC](https://answers.netlify.com/t/error-no-such-directory-did-you-forget-to-run-a-build-after-netlify-deploy-prod/55344/2 "2022-04-22T21:02:17Z")

</div>

Hiya, @oosp 👋

Welecome to the Netlify Forums! Sorry you are having trouble with your deploy.

[This Support Guide](https://answers.netlify.com/t/common-issue-frequently-encountered-problems-during-builds/213) contains a ton of useful debugging tips that can likely help you solve your problem 🙂 Additionally, this [Support Guide](https://answers.netlify.com/t/support-guide-compiled-build-and-deploy-resources-start-here/50679) houses all of our resources for debugging build and deploy issues.

We also recommend trying to search the forums with the build error you encountered - it’s likely your question was already asked by someone else!

If you are still having problems, please provide as much information as you can on what you have already tried, including:

1. the error message you are receiving
2. your full deploy log
3. what your build settings are
4. your `package.json`, `.toml` file, etc.

Thanks!

---

<div class="post-metadata">

**Author:** ![oosp](https://avatars.discourse-cdn.com/v4/letter/o/f08c70/32.png) [@oosp](https://answers.netlify.com/u/oosp)\
**Post date:** [April 23, 2022, 3:41pm UTC](https://answers.netlify.com/t/error-no-such-directory-did-you-forget-to-run-a-build-after-netlify-deploy-prod/55344/3 "2022-04-23T15:41:33Z")

</div>

Hello Hillary! My saviour! 🙂 I will try to be as much precise as I can. There is no trace of this error in the blog unfortunately.  
The error appears at the final stage of my deployment when I do the command netlify deploy --prod and it asks me for a publish directory and I type build. I tried also “public”, “dist” and “.” as well, no success.

1)This is the error:

```auto

(➜ portfolio-frontend git:(main) netlify deploy --prod
Please provide a publish directory (e.g. "public" or "dist" or "."):
/Users/oosp/development/portfolio/portfolio-frontend
? Publish directory /Users/oosp/development/portfolio/portfolio-frontend/build 
Deploy path: /Users/oosp/development/portfolio/portfolio-frontend/build 
 › Error: No such directory /Users/oosp/development/portfolio/portfolio-frontend/build ! Did you forget 
 › to run a build?

```

1. The last full deploy logs are these:  
6:02:41 PM: Creating deploy upload records  
6:03:21 PM: Starting post processing  
6:03:21 PM: Post processing - HTML  
6:03:22 PM: Post processing - header rules  
6:03:22 PM: Post processing - redirect rules  
6:03:22 PM: Post processing done  
6:03:25 PM: Site is live ✨

This one is showing a black screen and it’s the last one I tried, this one is the result of choosing “.” as a publish directory.

1. 6:01:13 PM: Canceling deploy

This one is the one that appears when I type build as a publish directory

1. I can’t see the build setting if these indications are correct: **Site settings \> Build & deploy \> Continuous Deployment \> Build settings**. Please let me know if the latter is not correct. I don’t see any .toml file

4)my package.json:

```auto
{
  "name": "portfolio-frontend",
  "version": "0.1.0",
  "private": true,
  "dependencies": {
    "@testing-library/jest-dom": "^5.16.3",
    "@testing-library/react": "^12.1.4",
    "@testing-library/user-event": "^13.5.0",
    "devicon": "^2.15.1",
    "react": "^17.0.2",
    "react-dom": "^17.0.2",
    "react-router-dom": "^6.2.2",
    "react-scripts": "5.0.0",
    "web-vitals": "^2.1.4"
  },
  "scripts": {
    "start": "react-scripts start",
    "build": "react-scripts build",
    "test": "react-scripts test",
    "eject": "react-scripts eject"
  },
  "eslintConfig": {
    "extends": [
      "react-app",
      "react-app/jest"
    ]
  },
  "browserslist": {
    "production": [
      ">0.2%",
      "not dead",
      "not op_mini all"
    ],
    "development": [
      "last 1 chrome version",
      "last 1 firefox version",
      "last 1 safari version"
    ]
  }
}

```

Thank you very much!

---

<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:** [April 24, 2022, 1:21pm UTC](https://answers.netlify.com/t/error-no-such-directory-did-you-forget-to-run-a-build-after-netlify-deploy-prod/55344/4 "2022-04-24T13:21:00Z")

</div>

Hey @oosp,

Since you’re deploying via CLI, there’s no way for us to check what’s happening locally. Would it be possible for you to share the repo?

---

<div class="post-metadata">

**Author:** ![oosp](https://avatars.discourse-cdn.com/v4/letter/o/f08c70/32.png) [@oosp](https://answers.netlify.com/u/oosp)\
**Post date:** [April 25, 2022, 10:03am UTC](https://answers.netlify.com/t/error-no-such-directory-did-you-forget-to-run-a-build-after-netlify-deploy-prod/55344/5 "2022-04-25T10:03:33Z")

</div>

Hello @hrishikesh! Thank you very much for replying to me!  
Of course!

This is my repo: [https://github.com/ornellaspada/portfolio-](https://github.com/ornellaspada/portfolio-)

I look forward to receiving any update from you! Thank you again! 🙂

---

<div class="post-metadata">

**Author:** ![oosp](https://avatars.discourse-cdn.com/v4/letter/o/f08c70/32.png) [@oosp](https://answers.netlify.com/u/oosp)\
**Post date:** [April 25, 2022, 4:55pm UTC](https://answers.netlify.com/t/error-no-such-directory-did-you-forget-to-run-a-build-after-netlify-deploy-prod/55344/6 "2022-04-25T16:55:06Z")

</div>

Dear @hrishikesh,  
I solved the issue, which was that I had to run again the npm run build before doing the re-deployment. Thanks!

---

<div class="post-metadata">

**Author:** ![hillary](https://sea1.discourse-cdn.com/netlify/user_avatar/answers.netlify.com/hillary/32/21132_2.png) [@hillary](https://answers.netlify.com/u/hillary)\
**Post date:** [April 25, 2022, 6:50pm UTC](https://answers.netlify.com/t/error-no-such-directory-did-you-forget-to-run-a-build-after-netlify-deploy-prod/55344/7 "2022-04-25T18:50:17Z")

</div>

Thank you so much for coming back and confirming! This will be beneficial to future forums members who encounter something similar.

Happy building 🚀
