Publish Directory

Site name: https://heuristic-haibt-de2472.netlify.app/

Repo that I am building from (master branch): GitHub - adamalston/v2: Personal website built using React!

This site is built in React.

My “Build command” is npm run build. However, I am unsure of what my “Publish Directory” should be. When I run npm run build locally, a build folder is created with the site that is to be deployed. Therefore, I have set the “Publish Directory” in Netlify to be build. Is this correct? If not, what should it be?

As you can see with the Netlify site https://heuristic-haibt-de2472.netlify.app/, the page is blank. My intended site looks like this adamalston.github.io/v2/ which is the same site from the GitHub repo deployed to GitHub pages. This leads me to believe that build is the wrong Publish Directory.

12:43:13 AM: Build ready to start
12:43:14 AM: build-image version: ca811f47d4c1cbd1812d1eb6ecb0c977e86d1a1d
12:43:14 AM: build-image tag: v3.3.20
12:43:14 AM: buildbot version: 78b5536ab4f742c26705d3e953381b9cde6e22ef
12:43:15 AM: Fetching cached dependencies
12:43:15 AM: Starting to download cache of 111.3MB
12:43:15 AM: Finished downloading cache in 856.289361ms
12:43:15 AM: Starting to extract cache
12:43:21 AM: Finished extracting cache in 5.624337946s
12:43:21 AM: Finished fetching cache in 6.50712441s
12:43:21 AM: Starting to prepare the repo for build
12:43:21 AM: Preparing Git Reference refs/heads/master
12:43:23 AM: Starting build script
12:43:23 AM: Installing dependencies
12:43:23 AM: Python version set to 2.7
12:43:23 AM: Started restoring cached node version
12:43:26 AM: Finished restoring cached node version
12:43:26 AM: v12.18.0 is already installed.
12:43:27 AM: Now using node v12.18.0 (npm v6.14.4)
12:43:27 AM: Started restoring cached build plugins
12:43:27 AM: Finished restoring cached build plugins
12:43:27 AM: Attempting ruby version 2.7.1, read from environment
12:43:29 AM: Using ruby version 2.7.1
12:43:29 AM: Using PHP version 5.6
12:43:29 AM: 5.2 is already installed.
12:43:29 AM: Using Swift version 5.2
12:43:29 AM: Started restoring cached node modules
12:43:29 AM: Finished restoring cached node modules
12:43:29 AM: Started restoring cached yarn cache
12:43:29 AM: Finished restoring cached yarn cache
12:43:30 AM: Installing NPM modules using Yarn version 1.22.4
12:43:30 AM: yarn install v1.22.4
12:43:30 AM: warning package-lock.json found. Your project contains lock files generated by tools other than Yarn. It is advised not to mix package managers in order to avoid resolution inconsistencies caused by unsynchronized lock files. To clear this warning, remove package-lock.json.
12:43:30 AM: [1/4] Resolving packages...
12:43:31 AM: [2/4] Fetching packages...
12:43:54 AM: info fsevents@2.1.2: The platform "linux" is incompatible with this module.
12:43:54 AM: info "fsevents@2.1.2" is an optional dependency and failed compatibility check. Excluding it from installation.
12:43:54 AM: info fsevents@1.2.13: The platform "linux" is incompatible with this module.
12:43:54 AM: info "fsevents@1.2.13" is an optional dependency and failed compatibility check. Excluding it from installation.
12:43:54 AM: info fsevents@2.1.3: The platform "linux" is incompatible with this module.
12:43:54 AM: info "fsevents@2.1.3" is an optional dependency and failed compatibility check. Excluding it from installation.
12:43:54 AM: [3/4] Linking dependencies...
12:43:54 AM: warning " > @testing-library/user-event@7.2.1" has unmet peer dependency "@testing-library/dom@>=5".
12:43:54 AM: warning "react-scripts > @typescript-eslint/eslint-plugin > tsutils@3.17.1" has unmet peer dependency "typescript@>=2.8.0 || >= 3.2.0-dev || >= 3.3.0-dev || >= 3.4.0-dev || >= 3.5.0-dev || >= 3.6.0-dev || >= 3.6.0-beta || >= 3.7.0-dev || >= 3.7.0-beta".
12:44:08 AM: [4/4] Building fresh packages...
12:44:09 AM: success Saved lockfile.
12:44:09 AM: Done in 38.65s.
12:44:09 AM: NPM modules installed using Yarn
12:44:09 AM: Started restoring cached go cache
12:44:09 AM: Finished restoring cached go cache
12:44:09 AM: go version go1.14.4 linux/amd64
12:44:09 AM: go version go1.14.4 linux/amd64
12:44:09 AM: Installing missing commands
12:44:09 AM: Verify run directory
12:44:10 AM: ​
12:44:10 AM: ┌─────────────────────────────┐
12:44:10 AM: │        Netlify Build        │
12:44:10 AM: └─────────────────────────────┘
12:44:10 AM: ​
12:44:10 AM: ❯ Version
12:44:10 AM:   @netlify/build 2.0.27
12:44:10 AM: ​
12:44:10 AM: ❯ Flags
12:44:10 AM:   deployId: 5f0be6615b768e02fe60c8b2
12:44:10 AM:   mode: buildbot
12:44:10 AM: ​
12:44:10 AM: ❯ Current directory
12:44:10 AM:   /opt/build/repo
12:44:10 AM: ​
12:44:10 AM: ❯ Config file
12:44:10 AM:   No config file was defined: using default values.
12:44:10 AM: ​
12:44:10 AM: ❯ Context
12:44:10 AM:   production
12:44:10 AM: ​
12:44:10 AM: ┌───────────────────────────────────┐
12:44:10 AM: │ 1. Build command from Netlify app │
12:44:10 AM: └───────────────────────────────────┘
12:44:10 AM: ​
12:44:10 AM: $ npm run build
12:44:10 AM: > v2@0.1.0 build /opt/build/repo
12:44:10 AM: > react-scripts build
12:44:12 AM: Creating an optimized production build...
12:44:17 AM: Compiled successfully.
12:44:17 AM: 
12:44:17 AM: File sizes after gzip:
12:44:17 AM:   52.14 KB  build/static/js/2.a6c9e675.chunk.js
12:44:17 AM:   781 B     build/static/js/runtime-main.5ceacc7e.js
12:44:17 AM:   758 B     build/static/js/main.27e2f2e7.chunk.js
12:44:17 AM:   600 B     build/static/css/main.6c4caa3d.chunk.css
12:44:17 AM: The project was built assuming it is hosted at /www.adamalston.com/.
12:44:17 AM: You can control this with the homepage field in your package.json.
12:44:17 AM: The build folder is ready to be deployed.
12:44:17 AM: Find out more about deployment here:
12:44:17 AM:   bit.ly/CRA-deploy
12:44:17 AM: ​
12:44:17 AM: (build.command completed in 6.7s)
12:44:17 AM: ​
12:44:17 AM: ┌─────────────────────────────┐
12:44:17 AM: │   Netlify Build Complete    │
12:44:17 AM: └─────────────────────────────┘
12:44:17 AM: ​
12:44:17 AM: (Netlify Build completed in 6.8s)
12:44:17 AM: Caching artifacts
12:44:17 AM: Started saving node modules
12:44:17 AM: Finished saving node modules
12:44:17 AM: Started saving build plugins
12:44:17 AM: Finished saving build plugins
12:44:17 AM: Started saving yarn cache
12:44:17 AM: Finished saving yarn cache
12:44:17 AM: Started saving pip cache
12:44:17 AM: Finished saving pip cache
12:44:17 AM: Started saving emacs cask dependencies
12:44:17 AM: Finished saving emacs cask dependencies
12:44:17 AM: Started saving maven dependencies
12:44:17 AM: Finished saving maven dependencies
12:44:17 AM: Started saving boot dependencies
12:44:17 AM: Finished saving boot dependencies
12:44:17 AM: Started saving go dependencies
12:44:17 AM: Finished saving go dependencies
12:44:17 AM: Build script success
12:44:17 AM: Starting to deploy site from 'build'
12:44:17 AM: Creating deploy tree 
12:44:17 AM: Creating deploy upload records
12:44:17 AM: 0 new files to upload
12:44:17 AM: 0 new functions to upload
12:44:18 AM: Starting post processing
12:44:18 AM: Post processing - HTML
12:44:18 AM: Post processing - redirect rules
12:44:18 AM: Post processing - header rules
12:44:18 AM: Post processing done
12:44:18 AM: Site is live
12:44:37 AM: Finished processing build request in 1m22.524585699s

hey there, i think we are super close to a working config for you.

could you pop a screenshot of your build settings please?

Hi, I think I have got it working now. Instead of using the Netlify team site to create a new site from git (which I have now deleted), I installed the Netlify CLI in my project directly. I was then able to play around with the “Publish Directory” until I got build/ to work.

My basic site is now live here: https://www.adamalston.com/


For the sake of future developers, I can create a new site with the same configuration as the one above.

Here is a screenshot of the build settings. This build is deployed here: https://flamboyant-goldstine-83f58d.netlify.app/

1 Like

sweet! great troubleshooting - congrats on getting it working.