Home
Support Forums

Getting error at Netlify Build Missing index.html file

Netlify site name: distracted-panini-c2b1b8.netlify.app

Trying to deploy new site. Create-React-App, frontend client and backend server. I’m getting the below build log with error. I have an index.html file in the /client/public folder so I’m not sure why it’s saying there isn’t one? Thanks!
Here is the GitHub repo associated: GitHub - adamkeenan88/chainalysis_project

10:17:36 PM: Build ready to start
10:17:37 PM: build-image version: c5b01a919d3e16af69445c5de0cacb49efbb1a23 (focal)
10:17:37 PM: build-image tag: v4.4.0
10:17:37 PM: buildbot version: 32ed0189d752047ee8dfb652c26d682ee00f88d8
10:17:37 PM: Building without cache
10:17:37 PM: Starting to prepare the repo for build
10:17:38 PM: No cached dependencies found. Cloning fresh repo
10:17:38 PM: git clone GitHub - adamkeenan88/chainalysis_project
10:17:44 PM: Preparing Git Reference refs/heads/main
10:17:45 PM: Parsing package.json dependencies
10:17:45 PM: Starting build script
10:17:45 PM: Installing dependencies
10:17:45 PM: Python version set to 2.7
10:17:46 PM: Downloading and installing node v16.13.0…
10:17:46 PM: Downloading https://nodejs.org/dist/v16.13.0/node-v16.13.0-linux-x64.tar.xz
10:17:47 PM: Computing checksum with sha256sum
10:17:47 PM: Checksums matched!
10:17:50 PM: Now using node v16.13.0 (npm v8.1.0)
10:17:50 PM: Started restoring cached build plugins
10:17:50 PM: Finished restoring cached build plugins
10:17:50 PM: Attempting ruby version 2.7.2, read from environment
10:17:51 PM: Using ruby version 2.7.2
10:17:52 PM: Using PHP version 8.0
10:17:52 PM: Started restoring cached node modules
10:17:52 PM: Finished restoring cached node modules
10:17:52 PM: Installing NPM modules using NPM version 8.1.0
10:18:07 PM: npm WARN deprecated urix@0.1.0: Please see GitHub - lydell/urix: [DEPRECATED] Makes Windows-style paths more unix and URI friendly.
10:18:11 PM: npm WARN deprecated resolve-url@0.2.1: GitHub - lydell/resolve-url: [DEPRECATED] Like Node.js’ `path.resolve`/`url.resolve` for the browser.
10:18:23 PM: npm WARN deprecated flatten@1.0.3: flatten is deprecated in favor of utility frameworks such as lodash.
10:18:36 PM: npm WARN deprecated sane@4.1.0: some dependency vulnerabilities fixed, support for node < 10 dropped, and newer ECMAScript syntax/features added
10:18:36 PM: npm WARN deprecated rollup-plugin-babel@4.4.0: This package has been deprecated and is no longer maintained. Please use @rollup/plugin-babel.
10:18:37 PM: npm WARN deprecated uuid@3.4.0: Please upgrade to version 7 or higher. Older versions may use Math.random() in certain circumstances, which is known to be problematic. See There’s Math.random(), and then there’s Math.random() · V8 for details.
10:18:37 PM: npm WARN deprecated uuid@3.4.0: Please upgrade to version 7 or higher. Older versions may use Math.random() in certain circumstances, which is known to be problematic. See There’s Math.random(), and then there’s Math.random() · V8 for details.
10:18:37 PM: npm WARN deprecated querystring@0.2.1: The querystring API is considered Legacy. new code should use the URLSearchParams API instead.
10:18:37 PM: npm WARN deprecated querystring@0.2.0: The querystring API is considered Legacy. new code should use the URLSearchParams API instead.
10:18:46 PM: npm WARN deprecated svgo@1.3.2: This SVGO version is no longer supported. Upgrade to v2.x.x.
10:18:47 PM: npm WARN deprecated chokidar@2.1.8: Chokidar 2 will break on node v14+. Upgrade to chokidar 3 with 15x less dependencies.
10:18:47 PM: npm WARN deprecated chokidar@2.1.8: Chokidar 2 will break on node v14+. Upgrade to chokidar 3 with 15x less dependencies.
10:18:47 PM: npm WARN deprecated babel-eslint@10.1.0: babel-eslint is now @babel/eslint-parser. This package will no longer receive updates.
10:18:49 PM: npm WARN deprecated @hapi/topo@3.1.6: This version has been deprecated and is no longer supported or maintained
10:18:49 PM: npm WARN deprecated @hapi/bourne@1.3.2: This version has been deprecated and is no longer supported or maintained
10:18:50 PM: npm WARN deprecated @hapi/address@2.1.4: Moved to ‘npm install @sideway/address’
10:18:50 PM: npm WARN deprecated @hapi/hoek@8.5.1: This version has been deprecated and is no longer supported or maintained
10:18:51 PM: npm WARN deprecated @hapi/joi@15.1.1: Switch to ‘npm install joi’
10:18:57 PM: npm WARN deprecated core-js@2.6.12: core-js@<3.3 is no longer maintained and not recommended for usage due to the number of issues. Because of the V8 engine whims, feature detection in old core-js versions could cause a slowdown up to 100x even if nothing is polyfilled. Please, upgrade your dependencies to the actual version of core-js.
10:18:59 PM: added 1946 packages, and audited 1947 packages in 1m
10:18:59 PM: 153 packages are looking for funding
10:18:59 PM: run npm fund for details
10:18:59 PM: 58 vulnerabilities (16 moderate, 40 high, 2 critical)
10:18:59 PM: To address issues that do not require attention, run:
10:18:59 PM: npm audit fix
10:18:59 PM: To address all issues (including breaking changes), run:
10:18:59 PM: npm audit fix --force
10:18:59 PM: Run npm audit for details.
10:18:59 PM: NPM modules installed
10:18:59 PM: Started restoring cached go cache
10:18:59 PM: Finished restoring cached go cache
10:19:00 PM: go version go1.16.5 linux/amd64
10:19:00 PM: go version go1.16.5 linux/amd64
10:19:00 PM: Installing missing commands
10:19:00 PM: Verify run directory
10:19:01 PM: ​
10:19:01 PM: ────────────────────────────────────────────────────────────────
10:19:01 PM: Netlify Build
10:19:01 PM: ────────────────────────────────────────────────────────────────
10:19:01 PM: ​
10:19:01 PM: ❯ Version
10:19:01 PM: @netlify/build 18.21.3
10:19:01 PM: ​
10:19:01 PM: ❯ Flags
10:19:01 PM: baseRelDir: true
10:19:01 PM: buildId: 618350d03eb7403845c853bd
10:19:01 PM: deployId: 618350d03eb7403845c853bf
10:19:01 PM: ​
10:19:01 PM: ❯ Current directory
10:19:01 PM: /opt/build/repo
10:19:01 PM: ​
10:19:01 PM: ❯ Config file
10:19:01 PM: No config file was defined: using default values.
10:19:01 PM: ​
10:19:01 PM: ❯ Context
10:19:01 PM: production
10:19:01 PM: ​
10:19:01 PM: ────────────────────────────────────────────────────────────────
10:19:01 PM: 1. Build command from Netlify app
10:19:01 PM: ────────────────────────────────────────────────────────────────
10:19:01 PM: ​
10:19:01 PM: $ npm run build
10:19:02 PM: > client@0.1.0 build
10:19:02 PM: > react-scripts build
10:19:04 PM: Could not find a required file.
10:19:04 PM: Name: index.html
10:19:04 PM: Searched in: /opt/build/repo/public
10:19:04 PM: ​
10:19:04 PM: ────────────────────────────────────────────────────────────────
10:19:04 PM: “build.command” failed
10:19:04 PM: ────────────────────────────────────────────────────────────────
10:19:04 PM: ​
10:19:04 PM: Error message
10:19:04 PM: Command failed with exit code 1: npm run build
10:19:04 PM: ​
10:19:04 PM: Error location
10:19:04 PM: In Build command from Netlify app:
10:19:04 PM: npm run build
10:19:04 PM: ​
10:19:04 PM: Resolved config
10:19:04 PM: build:
10:19:04 PM: command: npm run build
10:19:04 PM: commandOrigin: ui
10:19:04 PM: publish: /opt/build/repo/build
10:19:04 PM: publishOrigin: ui
10:19:04 PM: Caching artifacts
10:19:04 PM: Started saving node modules
10:19:04 PM: Finished saving node modules
10:19:04 PM: Started saving build plugins
10:19:04 PM: Finished saving build plugins
10:19:04 PM: Started saving pip cache
10:19:04 PM: Finished saving pip cache
10:19:04 PM: Started saving emacs cask dependencies
10:19:04 PM: Finished saving emacs cask dependencies
10:19:04 PM: Started saving maven dependencies
10:19:04 PM: Finished saving maven dependencies
10:19:04 PM: Started saving boot dependencies
10:19:04 PM: Finished saving boot dependencies
10:19:04 PM: Started saving rust rustup cache
10:19:04 PM: Finished saving rust rustup cache
10:19:04 PM: Started saving go dependencies
10:19:04 PM: Finished saving go dependencies
10:19:07 PM: Build failed due to a user error: Build script returned non-zero exit code: 2
10:19:07 PM: Creating deploy upload records
10:19:07 PM: Failing build: Failed to build site
10:19:07 PM: Failed during stage ‘building site’: Build script returned non-zero exit code: 2
10:19:07 PM: Finished processing build request in 1m29.599734539s

Hi @adamkeenan88

You have two directories client and server in your repository but it appears you have not specified a base directory so the react-scripts build is assuming the src and public directories exist in the root of the repository.

You need to specify the base directory (I am guessing client). Have a look at this support guide

Thank you! I adjusted my base directory to “client” and I was able to get the front end aspect running. Unfortunately it’s not running my server now (which I think makes sense since I told netlify to only build my client folder right?). I need to have both aspects running for the site to work successfully. Going back to the initial issue then, should I just move the public folder out of the client folder and put it in the root directory? or should I move the server folder into client now so it’s all under one folder?

Thanks again and sorry if these are basic questions I should know lol

Adam

I see you’ve moved server into client.

Netlify’s system is for building, not for running server instances. I suggest looking over [Support Guide] Can I run a web server, HTTP listener, and/or database at Netlify?. You might need to investigate Heroku or similar platform for your server component.

Got it, that makes sense. Thank you so much!