9:20:19 AM: build-image version: 1ae4e4d7d5e3544ab1eb7f270391cdbb47c1e1e5 (focal)
9:20:19 AM: buildbot version: 1ae4e4d7d5e3544ab1eb7f270391cdbb47c1e1e5
9:20:19 AM: Building without cache
9:20:19 AM: Starting to prepare the repo for build
9:20:19 AM: No cached dependencies found. Cloning fresh repo
9:20:19 AM: git clone --filter=blob:none GitHub - fatnaelbassraoui/corporate-website
9:20:19 AM: Preparing Git Reference refs/heads/main
9:20:21 AM: Starting to install dependencies
9:20:21 AM: Python version set to 3.8
9:20:21 AM: Attempting Ruby version 2.7.2, read from environment
9:20:22 AM: Using Ruby version 2.7.2
9:20:22 AM: Started restoring cached go cache
9:20:22 AM: Finished restoring cached go cache
9:20:22 AM: go version go1.19.10 linux/amd64
9:20:22 AM: Using PHP version 8.0
9:20:23 AM: v18.16.1 is already installed.
9:20:24 AM: Now using node v18.16.1 (npm v9.5.1)
9:20:24 AM: Enabling Node.js Corepack
9:20:24 AM: Started restoring cached build plugins
9:20:24 AM: Finished restoring cached build plugins
9:20:24 AM: Install dependencies script success
9:20:24 AM: Starting build script
9:20:25 AM: Detected 0 framework(s)
9:20:25 AM: Section completed: initializing
9:20:28 AM: Failed during stage ‘building site’: Build script returned non-zero exit code: 2 (Search results for '"non-zero exit code: 2"' - Netlify Support Forums)
9:20:26 AM:
9:20:26 AM: Netlify Build
9:20:26 AM: ────────────────────────────────────────────────────────────────
9:20:26 AM:
9:20:26 AM: ❯ Version
9:20:26 AM: @netlify/build 29.15.3
9:20:26 AM:
9:20:26 AM: ❯ Flags
9:20:26 AM: baseRelDir: true
9:20:26 AM: buildId: 64abb1319a13932709419a61
9:20:26 AM: deployId: 64abb1319a13932709419a63
9:20:26 AM:
9:20:26 AM: ❯ Current directory
9:20:26 AM: /opt/build/repo
9:20:26 AM:
9:20:26 AM: ❯ Config file
9:20:26 AM: No config file was defined: using default values.
9:20:26 AM:
9:20:26 AM: ❯ Context
9:20:26 AM: production
9:20:26 AM:
9:20:26 AM: Build command from Netlify app
9:20:26 AM: ────────────────────────────────────────────────────────────────
9:20:26 AM:
9:20:26 AM: $ npm run build
9:20:27 AM: npm ERR! code ENOENT
9:20:27 AM: npm ERR! syscall open
9:20:27 AM: npm ERR! path /opt/build/repo/package.json
9:20:27 AM: npm ERR! errno -2
9:20:27 AM: npm ERR! enoent ENOENT: no such file or directory, open ‘/opt/build/repo/package.json’
9:20:27 AM: npm ERR! enoent This is related to npm not being able to find a file.
9:20:27 AM: npm ERR! enoent
9:20:27 AM: npm ERR! A complete log of this run can be found in:
9:20:27 AM: npm ERR! /opt/buildhome/.npm/_logs/2023-07-10T07_20_27_104Z-debug-0.log
9:20:27 AM:
9:20:27 AM: build.command failed
9:20:27 AM: ────────────────────────────────────────────────────────────────
9:20:27 AM:
9:20:27 AM: Error message
9:20:27 AM: Command failed with exit code 254: npm run build (Search results for '"non-zero exit code: 254"' - Netlify Support Forums)
9:20:27 AM:
9:20:27 AM: Error location
9:20:27 AM: In Build command from Netlify app:
9:20:27 AM: npm run build
9:20:27 AM:
9:20:27 AM: Resolved config
9:20:27 AM: build:
9:20:27 AM: command: npm run build
9:20:27 AM: commandOrigin: ui
9:20:27 AM: publish: /opt/build/repo/build
9:20:27 AM: publishOrigin: ui
9:20:27 AM: Caching artifacts
9:20:27 AM: Started saving build plugins
9:20:27 AM: Finished saving build plugins
9:20:27 AM: Started saving pip cache
9:20:27 AM: Finished saving pip cache
9:20:27 AM: Started saving emacs cask dependencies
9:20:27 AM: Finished saving emacs cask dependencies
9:20:27 AM: Started saving maven dependencies
9:20:27 AM: Finished saving maven dependencies
9:20:27 AM: Started saving boot dependencies
9:20:27 AM: Finished saving boot dependencies
9:20:27 AM: Started saving rust rustup cache
9:20:27 AM: Finished saving rust rustup cache
9:20:27 AM: Started saving go dependencies
9:20:27 AM: Finished saving go dependencies
9:20:28 AM: Build failed due to a user error: Build script returned non-zero exit code: 2
9:20:28 AM: Failing build: Failed to build site
9:20:29 AM: Finished processing build request in 9.832s
You’re running npm run build
but it cannot find a package.json
in the root of your repository.
Make sure you’re providing Netlify with the files that you think you are.
If you’re working with monorepo you’ll need to set your Base directory in your Basic build settings.
Hi @faty88,
Thanks for reaching out and welcome to Netlify’s Support forums!
Could you try adding progetto
to your Build settings here:
Let us know if you’re still having issues. Thanks!
Thank you guys I deployed my project
this is the link:
But now i have another problem. i added components to my project i committed to GitHub, but the site doesn’t update automatically, why?
Did you link your github to netlify. Can you try the following steps to unlink and relink:
- Unlink the account here: Netlify App .
- Log out of the github account on the github site
- Log in to the correct github account
- Once active in the correct account, link again
Let me know if that works!