React Deploy failing from git

I need advice to debug deploy https://app.netlify.com/sites/marcoserod-rick-and-morty-web/deploys/5edc54ff1311f8f5c6d10e37

hmm. I can’t see that deploy log. Did you delete or rename your account?

Maybe you can post the deploy log here? thanks.

Hi Perry, thanks for answering.

I’ve delete that site, because I thought i did something wrong from the begging(And didn’t know that i can still do manual deploys), but I’m having same issue no matter what i do(I chose to manually deploy my changes)

I might say that I’m pretty new at web development.

This is the log I've received, whenever i tried to work in continuous deployment.

12:41:31 AM: Build ready to start
12:41:33 AM: build-image version: 30f629161c0736b1a3ecd8b418e5eeffab5c0faf
12:41:33 AM: build-image tag: v3.3.14
12:41:33 AM: buildbot version: 960d989224ecbd0e01be03c5f7dffe3d8f543e02
12:41:33 AM: Fetching cached dependencies
12:41:33 AM: Failed to fetch cache, continuing with build
12:41:33 AM: Starting to prepare the repo for build
12:41:33 AM: No cached dependencies found. Cloning fresh repo
12:41:33 AM: git clone https://github.com/marcoserod/rickAndMorty
12:41:34 AM: Preparing Git Reference refs/heads/master
12:41:35 AM: Starting build script
12:41:35 AM: Installing dependencies
12:41:37 AM: Downloading and installing node v10.21.0...
12:41:37 AM: Downloading https://nodejs.org/dist/v10.21.0/node-v10.21.0-linux-x64.tar.xz...
12:41:38 AM: Computing checksum with sha256sum
12:41:38 AM: Checksums matched!
12:41:41 AM: Now using node v10.21.0 (npm v6.14.4)
12:41:41 AM: Started restoring cached build plugins
12:41:41 AM: Finished restoring cached build plugins
12:41:41 AM: Attempting ruby version 2.6.2, read from environment
12:41:42 AM: Using ruby version 2.6.2
12:41:42 AM: Using PHP version 5.6
12:41:43 AM: 5.2 is already installed.
12:41:43 AM: Using Swift version 5.2
12:41:43 AM: Started restoring cached go cache
12:41:43 AM: Finished restoring cached go cache
12:41:43 AM: go version go1.12 linux/amd64
12:41:43 AM: go version go1.12 linux/amd64
12:41:43 AM: Installing missing commands
12:41:43 AM: Verify run directory
12:41:44 AM: ​
12:41:44 AM: β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
12:41:44 AM: β”‚        Netlify Build        β”‚
12:41:44 AM: β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜
12:41:44 AM: ​
12:41:44 AM: ❯ Version
12:41:44 AM:   @netlify/build 1.0.14
12:41:44 AM: ​
12:41:44 AM: ❯ Flags
12:41:44 AM:   mode: buildbot
12:41:44 AM: ​
12:41:44 AM: ❯ Current directory
12:41:44 AM:   /opt/build/repo
12:41:44 AM: ​
12:41:44 AM: ❯ Config file
12:41:44 AM:   No config file was defined: using default values.
12:41:44 AM: ​
12:41:44 AM: ❯ Context
12:41:44 AM:   production
12:41:44 AM: ​
12:41:44 AM: β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
12:41:44 AM: β”‚ 1. Build command from settings β”‚
12:41:44 AM: β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜
12:41:44 AM: ​
12:41:44 AM: $ npm run build
12:41:45 AM: npm
12:41:45 AM:  ERR! code ENOENT
12:41:45 AM: npm
12:41:45 AM: ERR! syscall open
12:41:45 AM: npm
12:41:45 AM: ERR!
12:41:45 AM:  path
12:41:45 AM:  /opt/build/repo/package.json
12:41:45 AM: npm
12:41:45 AM: ERR! errno
12:41:45 AM:  -2
12:41:45 AM: npm ERR!
12:41:45 AM: enoent
12:41:45 AM:  ENOENT: no such file or directory, open '/opt/build/repo/package.json'
12:41:45 AM: npm
12:41:45 AM:  ERR!
12:41:45 AM: enoent This is related to npm not being able to find a file.
12:41:45 AM: npm
12:41:45 AM: ERR! enoent
12:41:45 AM: npm ERR!
12:41:45 AM:  A complete log of this run can be found in:
12:41:45 AM: npm ERR!     /opt/buildhome/.npm/_logs/2020-06-07T03_41_45_295Z-debug.log
12:41:45 AM: ​
12:41:45 AM: β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
12:41:45 AM: β”‚   "build.command" failed    β”‚
12:41:45 AM: β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜
12:41:45 AM: ​
12:41:45 AM:   Error message
12:41:45 AM:   Command failed with exit code 254: npm run build
12:41:45 AM: ​
12:41:45 AM:   Error location
12:41:45 AM:   In Build command from settings:
12:41:45 AM:   npm run build
12:41:45 AM: ​
12:41:45 AM:   Resolved config
12:41:45 AM:   build:
12:41:45 AM:     command: npm run build
12:41:45 AM:     publish: /opt/build/repo/build
12:41:45 AM: Caching artifacts
12:41:45 AM: Started saving build plugins
12:41:45 AM: Finished saving build plugins
12:41:45 AM: Started saving pip cache
12:41:45 AM: Finished saving pip cache
12:41:45 AM: Started saving emacs cask dependencies
12:41:45 AM: Finished saving emacs cask dependencies
12:41:45 AM: Started saving maven dependencies
12:41:45 AM: Finished saving maven dependencies
12:41:45 AM: Started saving boot dependencies
12:41:45 AM: Finished saving boot dependencies
12:41:45 AM: Started saving go dependencies
12:41:45 AM: Finished saving go dependencies
12:41:49 AM: Error running command: Build script returned non-zero exit code: 1
12:41:49 AM: Failing build: Failed to build site
12:41:49 AM: Failed during stage 'building site': Build script returned non-zero exit code: 1
12:41:49 AM: Finished processing build request in 16.212399201s

This is my repo https://github.com/marcoserod/rickAndMorty/tree/master/rick-morty
This is my new site, if need i can create a new bug.

https://app.netlify.com/sites/the-rickandmorty-marcoserod/deploys/5edc61eb22763e19bea0383b

hey there, thanks for that. Could you pop a screenshot of your build settings please?

Sure,

I’ve also tried ./build but same result.

Hi, @marcoserod, this is the error from the build log:

8:41:45 PM:  ENOENT: no such file or directory, open '/opt/build/repo/package.json'

Our build system clones the repo into the directory /opt/build/repo/. The build command npm run build looks for package.json in the base of the repo (which again is /opt/build/repo/). So, the build system is looking for this file:

/opt/build/repo/package.json

For this repo, however, the package.json file is located in the subdirectory rick-morty.

This means the file (package.json) is actually found here:

/opt/build/repo/rick-morty/package.json

The solution is to change the β€œBase directory” setting in the build settings to rick-morty.

Please let us know if there are questions and/or if this does not resolve the issue.

Thanks @luke !
That’s works for me! Really appreciate the help :slight_smile:

1 Like