Home
Support Forums

Deploy Problem i'm newbie here please help

2:05:51 PM: Build ready to start
2:05:53 PM: build-image version: 653805ca4a64301556e56dc4b321ef8fc20cbb7c
2:05:53 PM: build-image tag: v3.8.2
2:05:53 PM: buildbot version: ccda11705f87435917703d79785086e961e5d73c
2:05:53 PM: Fetching cached dependencies
2:05:53 PM: Failed to fetch cache, continuing with build
2:05:53 PM: Starting to prepare the repo for build
2:05:54 PM: No cached dependencies found. Cloning fresh repo
2:05:54 PM: git clone GitHub - IvHrIvanov/Site-Ivan
2:05:57 PM: Preparing Git Reference refs/heads/main
2:05:59 PM: Parsing package.json dependencies
2:05:59 PM: Different publish path detected, going to use the one specified in the Netlify configuration file: β€˜build’ versus β€˜build/’ in the Netlify UI
2:06:00 PM: Starting build script
2:06:00 PM: Installing dependencies
2:06:00 PM: Python version set to 2.7
2:06:01 PM: v12.18.0 is already installed.
2:06:02 PM: Now using node v12.18.0 (npm v6.14.4)
2:06:02 PM: Started restoring cached build plugins
2:06:02 PM: Finished restoring cached build plugins
2:06:02 PM: Attempting ruby version 2.7.2, read from environment
2:06:03 PM: Using ruby version 2.7.2
2:06:04 PM: Using PHP version 5.6
2:06:04 PM: Started restoring cached go cache
2:06:04 PM: Finished restoring cached go cache
2:06:04 PM: go version go1.14.4 linux/amd64
2:06:04 PM: go version go1.14.4 linux/amd64
2:06:04 PM: Installing missing commands
2:06:04 PM: Verify run directory
2:06:04 PM: ​
2:06:04 PM: ────────────────────────────────────────────────────────────────
2:06:04 PM: Netlify Build
2:06:04 PM: ────────────────────────────────────────────────────────────────
2:06:04 PM: ​
2:06:04 PM: ❯ Version
2:06:04 PM: @netlify/build 16.1.0
2:06:04 PM: ​
2:06:04 PM: ❯ Flags
2:06:04 PM: deployId: 60faa28f54e154bf47734297
2:06:04 PM: ​
2:06:04 PM: ❯ Current directory
2:06:04 PM: /opt/build/repo
2:06:04 PM: ​
2:06:04 PM: ❯ Config file
2:06:04 PM: No config file was defined: using default values.
2:06:04 PM: ​
2:06:04 PM: ❯ Context
2:06:04 PM: production
2:06:04 PM: ​
2:06:04 PM: ────────────────────────────────────────────────────────────────
2:06:04 PM: 1. Build command from Netlify app
2:06:04 PM: ────────────────────────────────────────────────────────────────
2:06:04 PM: ​
2:06:04 PM: $ CI= npm run build
2:06:05 PM: npm ERR! code ENOENT
2:06:05 PM: npm ERR! syscall open
2:06:05 PM: npm ERR! path /opt/build/repo/package.json
2:06:05 PM: npm ERR! errno -2
2:06:05 PM: npm ERR! enoent ENOENT: no such file or directory, open β€˜/opt/build/repo/package.json’
2:06:05 PM: npm ERR! enoent This is related to npm not being able to find a file.
2:06:05 PM: npm ERR! enoent
2:06:05 PM: npm ERR! A complete log of this run can be found in:
2:06:05 PM: npm ERR! /opt/buildhome/.npm/_logs/2021-07-23T11_06_05_228Z-debug.log
2:06:05 PM: ​
2:06:05 PM: ────────────────────────────────────────────────────────────────
2:06:05 PM: β€œbuild.command” failed
2:06:05 PM: ────────────────────────────────────────────────────────────────
2:06:05 PM: ​
2:06:05 PM: Error message
2:06:05 PM: Command failed with exit code 254: CI= npm run build
2:06:05 PM: ​
2:06:05 PM: Error location
2:06:05 PM: In Build command from Netlify app:
2:06:05 PM: CI= npm run build
2:06:05 PM: ​
2:06:05 PM: Resolved config
2:06:05 PM: build:
2:06:05 PM: command: CI= npm run build
2:06:05 PM: commandOrigin: ui
2:06:05 PM: publish: /opt/build/repo/build
2:06:05 PM: publishOrigin: ui
2:06:05 PM: Caching artifacts
2:06:05 PM: Started saving build plugins
2:06:05 PM: Finished saving build plugins
2:06:05 PM: Started saving pip cache
2:06:05 PM: Finished saving pip cache
2:06:05 PM: Started saving emacs cask dependencies
2:06:05 PM: Finished saving emacs cask dependencies
2:06:05 PM: Started saving maven dependencies
2:06:05 PM: Finished saving maven dependencies
2:06:05 PM: Started saving boot dependencies
2:06:05 PM: Finished saving boot dependencies
2:06:05 PM: Started saving rust rustup cache
2:06:05 PM: Finished saving rust rustup cache
2:06:05 PM: Started saving go dependencies
2:06:05 PM: Finished saving go dependencies
2:06:10 PM: Build failed due to a user error: Build script returned non-zero exit code: 2
2:06:10 PM: Creating deploy upload records
2:06:10 PM: Failing build: Failed to build site
2:06:10 PM: Failed during stage β€˜building site’: Build script returned non-zero exit code: 2
2:06:10 PM: Finished processing build request in 17.062266485s

Hi there, glad you found us :wave: before we can help you, we need some more information on the issues you are facing.

Please tell us:

  • the name of your build instance: β€œexample-jones.netlify.com”
  • what you are trying to accomplish
  • what you have already tried
  • any error messages you have received in your terminal window or in the developer console

Thank you!

I want when i make a update to my site to update in netlify automaticly.

hi @IvHrIvanov - if you read the error message, you will see that this is the problem:

2:06:05 PM: npm ERR! code ENOENT
2:06:05 PM: npm ERR! syscall open
2:06:05 PM: npm ERR! path /opt/build/repo/package.json
2:06:05 PM: npm ERR! errno -2
2:06:05 PM: npm ERR! enoent ENOENT: no such file or directory, open β€˜/opt/build/repo/package.json’
2:06:05 PM: npm ERR! enoent This is related to npm not being able to find a file.
2:06:05 PM: npm ERR! enoent

your project requires a package.json file if you are doing anything more complex than just deploying static html - you will need to include a correct package.json file in your project for this to work.

more details and debugging info here:

ok my error now is this
10:59:21 PM: 1. Build command from Netlify app
10:59:21 PM: ────────────────────────────────────────────────────────────────
10:59:21 PM: ​
10:59:21 PM: $ CI= npm run build
10:59:21 PM: npm ERR! missing script: build
10:59:21 PM: npm ERR! A complete log of this run can be found in:
10:59:21 PM: npm ERR! /opt/buildhome/.npm/_logs/2021-07-23T19_59_21_548Z-debug.log
10:59:21 PM: ​
10:59:21 PM: ────────────────────────────────────────────────────────────────
10:59:21 PM: β€œbuild.command” failed

now i add this script
{

β€œname”: β€œcv”,

β€œversion”: β€œ1.0.0”,

β€œdescription”: β€œSite”,

β€œmain”: β€œfunc.js”,

β€œscripts”: {

"build": "npm run build",

"develop": "gatsby develop",

"format": "prettier --write **/*.{js,jsx,json,md}",

"start": "npm run develop",

"serve": "gatsby serve",

"clean": "gatsby clean"

},

β€œkeywords”: [

"Site",

"MySite"

],

β€œauthor”: β€œIvan Ivanov”,

β€œlicense”: β€œISC”,

β€œdependencies”: {

"react": "^17.0.2",

"react-dom": "^17.0.2"

}

}
and now result is loop
1:28:31 PM: > npm run build

11:28:32 PM: > cv@1.0.0 build /opt/build/repo

11:28:32 PM: > npm run build

11:28:32 PM: > cv@1.0.0 build /opt/build/repo

11:28:32 PM: > npm run build

11:28:32 PM: > cv@1.0.0 build /opt/build/repo

11:28:32 PM: > npm run build

11:28:33 PM: > cv@1.0.0 build /opt/build/repo

11:28:33 PM: > npm run build

11:28:33 PM: > cv@1.0.0 build /opt/build/repo

11:28:33 PM: > npm run build

11:28:33 PM: > cv@1.0.0 build /opt/build/repo

11:28:33 PM: > npm run build

11:28:33 PM: > cv@1.0.0 build /opt/build/repo

11:28:33 PM: > npm run build

11:28:34 PM: > cv@1.0.0 build /opt/build/repo

11:28:34 PM: > npm run build

11:28:34 PM: > cv@1.0.0 build /opt/build/repo

11:28:34 PM: > npm run build

11:28:34 PM: > cv@1.0.0 build /opt/build/repo

11:28:34 PM: > npm run build

11:28:34 PM: > cv@1.0.0 build /opt/build/repo

11:28:34 PM: > npm run build

11:28:35 PM: > cv@1.0.0 build /opt/build/repo

11:28:35 PM: > npm run build

11:28:35 PM: > cv@1.0.0 build /opt/build/repo

11:28:35 PM: > npm run build

11:28:35 PM: > cv@1.0.0 build /opt/build/repo

11:28:35 PM: > npm run build

11:28:36 PM: > cv@1.0.0 build /opt/build/repo

11:28:36 PM: > npm run build

11:28:36 PM: > cv@1.0.0 build /opt/build/repo

11:28:36 PM: > npm run build

11:28:36 PM: > cv@1.0.0 build /opt/build/repo

11:28:36 PM: > npm run build

11:28:36 PM: > cv@1.0.0 build /opt/build/repo

11:28:36 PM: > npm run build

11:28:37 PM: > cv@1.0.0 build /opt/build/repo

11:28:37 PM: > npm run build

11:28:37 PM: > cv@1.0.0 build /opt/build/repo

11:28:37 PM: > npm run build

11:28:37 PM: > cv@1.0.0 build /opt/build/repo

11:28:37 PM: > npm run build

11:28:37 PM: > cv@1.0.0 build /opt/build/repo

11:28:37 PM: > npm run build

HI @IvHrIvanov

Looking at your repo it appears you have a simple HTML page (only one page) so there is actually nothing that needs building. Therefore, your build command in Netlify should remain empty. If you are not building anything, there is no need for the package.json and package-lock.json files.

Note that node_modules directory is generally added to the .gitignore file so it isn’t pushed to git.

2 Likes

Its work! Ty so much!

1 Like