Home
Support Forums

Page Not Found /Broken link

I have an issue this message pops up when open the NETLIFY URL
The message : Page Not Found

Looks like you’ve followed a broken link or entered a URL that doesn’t exist on this site.

Back to our site

If this is your site, and you weren’t expecting a 404 for this path, please visit Netlify’s “page not found” support guide for troubleshooting tips.

Netlify -URL :https://nifty-yonath-80e6e0.netlify.app/

GitHub URL :GitHub - Zaina-coder/dictionary-project.

The index.html is in the public directory and not the project root. Your file is viewable at https://nifty-yonath-80e6e0.netlify.app/public/.

You need to set your publish directory (docs) to public or move the index.html to the project root.

Hello , I have made some change in deploy setting on build command, publish directory etc… and still not working. also I moved the index.html to project root which is src and didn’t show up anything at all .
12:01:32 PM: Build ready to start
12:02:01 PM: build-image version: 6c366b9e0cc38bb3f3a40b7951f398b33cac286d
12:02:01 PM: build-image tag: v3.8.1
12:02:01 PM: buildbot version: d6f7e5fc881fb3682c2d42eb968d84e9b04dfca0
12:02:01 PM: Building without cache
12:02:01 PM: Starting to prepare the repo for build
12:02:02 PM: No cached dependencies found. Cloning fresh repo
12:02:02 PM: git clone GitHub - Zaina-coder/dictionary-project
12:02:04 PM: Preparing Git Reference refs/heads/main
12:02:04 PM: Parsing package.json dependencies
12:02:05 PM: Starting build script
12:02:05 PM: Installing dependencies
12:02:05 PM: Python version set to 2.7
12:02:06 PM: v12.18.0 is already installed.
12:02:06 PM: Now using node v12.18.0 (npm v6.14.4)
12:02:06 PM: Started restoring cached build plugins
12:02:06 PM: Finished restoring cached build plugins
12:02:07 PM: Attempting ruby version 2.7.2, read from environment
12:02:08 PM: Using ruby version 2.7.2
12:02:08 PM: Using PHP version 5.6
12:02:08 PM: Started restoring cached go cache
12:02:08 PM: Finished restoring cached go cache
12:02:08 PM: go version go1.14.4 linux/amd64
12:02:08 PM: go version go1.14.4 linux/amd64
12:02:08 PM: Installing missing commands
12:02:08 PM: Verify run directory
12:02:09 PM: ​
12:02:09 PM: ────────────────────────────────────────────────────────────────
12:02:09 PM: Netlify Build
12:02:09 PM: ────────────────────────────────────────────────────────────────
12:02:09 PM: ​
12:02:09 PM: ❯ Version
12:02:09 PM: @netlify/build 15.11.5
12:02:09 PM: ​
12:02:09 PM: ❯ Flags
12:02:09 PM: deployId: 60f47a8bd262933939ea75b5
12:02:09 PM: ​
12:02:09 PM: ❯ Current directory
12:02:09 PM: /opt/build/repo
12:02:09 PM: ​
12:02:09 PM: ❯ Config file
12:02:09 PM: No config file was defined: using default values.
12:02:09 PM: ​
12:02:09 PM: ❯ Context
12:02:09 PM: production
12:02:09 PM: ​
12:02:09 PM: ────────────────────────────────────────────────────────────────
12:02:09 PM: 1. Build command from Netlify app
12:02:09 PM: ────────────────────────────────────────────────────────────────
12:02:09 PM: ​
12:02:09 PM: $ npm run build
12:02:09 PM: npm ERR! code ENOENT
12:02:09 PM: npm ERR! syscall open
12:02:09 PM: npm ERR! path /opt/build/repo/package.json
12:02:09 PM: npm ERR! errno -2
12:02:09 PM: npm ERR! enoent ENOENT: no such file or directory, open ‘/opt/build/repo/package.json’
12:02:09 PM: npm ERR! enoent This is related to npm not being able to find a file.
12:02:09 PM: npm ERR! enoent
12:02:09 PM: npm ERR! A complete log of this run can be found in:
12:02:09 PM: npm ERR! /opt/buildhome/.npm/_logs/2021-07-18T19_02_09_563Z-debug.log
12:02:09 PM: ​
12:02:09 PM: ────────────────────────────────────────────────────────────────
12:02:09 PM: “build.command” failed
12:02:09 PM: ────────────────────────────────────────────────────────────────
12:02:09 PM: ​
12:02:09 PM: Error message
12:02:09 PM: Command failed with exit code 254: npm run build
12:02:09 PM: ​
12:02:09 PM: Error location
12:02:09 PM: In Build command from Netlify app:
12:02:09 PM: npm run build
12:02:09 PM: ​
12:02:09 PM: Resolved config
12:02:09 PM: build:
12:02:09 PM: command: npm run build
12:02:09 PM: commandOrigin: ui
12:02:09 PM: publish: /opt/build/repo/build
12:02:09 PM: publishOrigin: ui
12:02:09 PM: Caching artifacts
12:02:09 PM: Started saving build plugins
12:02:09 PM: Finished saving build plugins
12:02:09 PM: Started saving pip cache
12:02:10 PM: Finished saving pip cache
12:02:10 PM: Started saving emacs cask dependencies
12:02:10 PM: Finished saving emacs cask dependencies
12:02:10 PM: Started saving maven dependencies
12:02:10 PM: Finished saving maven dependencies
12:02:10 PM: Started saving boot dependencies
12:02:10 PM: Finished saving boot dependencies
12:02:10 PM: Started saving rust rustup cache
12:02:10 PM: Finished saving rust rustup cache
12:02:10 PM: Started saving go dependencies
12:02:10 PM: Finished saving go dependencies
12:02:12 PM: Build failed due to a user error: Build script returned non-zero exit code: 2
12:02:12 PM: Creating deploy upload records
12:02:12 PM: Failing build: Failed to build site
12:02:12 PM: Failed during stage ‘building site’: Build script returned non-zero exit code: 2
12:02:12 PM: Finished processing build request in 11.178029464s
GITHUB URL : GitHub - Zaina-coder/dictionary-project.
Netlify : Netlify App

This is because you have/had no package.json file in the project root (which originally you did not, you simply had a public directory containing an index.html file.)

The screenshot you have included is from a different site, but if you use the same settings as that, your build will succeed.

It worked :slight_smile: .Thank you !