Netlify deployment - Failed to fetch cache - reactjs

I don't normally have an issue deploying to Netlify. However, this time i'm getting a really short deploy log with a few issues not seen before. When i try to visit my site i get a blank page
LOG BELOW
2:44:07 PM: Build ready to start
2:44:09 PM: build-image version: 9cade8af58c2cf3a17a1e9433d2e979149488837
2:44:09 PM: build-image tag: v3.3.5
2:44:09 PM: buildbot version: 2d05064ce3dd2eb95d282a24602ab707dd9581e8
2:44:09 PM: Fetching cached dependencies
2:44:09 PM: Failed to fetch cache, continuing with build
2:44:09 PM: Starting to prepare the repo for build
2:44:10 PM: No cached dependencies found. Cloning fresh repo
2:44:10 PM: git clone https://github.com/Jrowan19/PS-FRONTEND
2:44:10 PM: Preparing Git Reference refs/heads/master
2:44:11 PM: No build command found, continuing to publishing
2:44:11 PM: Starting to deploy site from ‘/’
2:44:11 PM: Creating deploy tree
2:44:11 PM: 0 new files to upload
2:44:11 PM: 0 new functions to upload
2:44:11 PM: Starting post processing
2:44:11 PM: Post processing done
2:44:11 PM: Site is live
2:44:11 PM: Finished processing build request in 2.498321286s

Based on the repository folder layout, the build directory should be ps-frontend/build not the root (/) folder.

Related

Netlify deploy React Project failed (with error message: Command failed with exit code 1: npm run build)

Below is the message I got.
I have tried other solutions such as changing the deployed setting 'CI=npm build run' and set a new environmental variable CI false But none of them worked.
below is the version without setting the 'CI=npm build run' but set CI to false.
$ npm run build
1:51:55 PM: > anqi-portfolio#0.1.0 build
1:51:55 PM: > react-scripts build
1:51:56 PM: Creating an optimized production build...
1:51:56 PM: Failed to compile.
1:51:56 PM:
1:51:56 PM: Module not found: Error: Can't resolve '../src/pages/AboutPage' in '/opt/build/repo/src'
1:51:56 PM: ​
1:51:56 PM: "build.command" failed
1:51:56 PM: ────────────────────────────────────────────────────────────────
1:51:56 PM: ​
1:51:56 PM: Error message
1:51:56 PM: Command failed with exit code 1: npm run build (https://ntl.fyi/exit-code-1)
1:51:56 PM: ​
1:51:56 PM: Error location
1:51:56 PM: In Build command from Netlify app:
1:51:56 PM: npm run build
1:51:56 PM: ​
1:51:56 PM: Resolved config
1:51:56 PM: build:
1:51:56 PM: command: npm run build
1:51:56 PM: commandOrigin: ui
1:51:56 PM: environment:
1:51:56 PM: - CI
1:51:56 PM: publish: /opt/build/repo/build
1:51:56 PM: publishOrigin: ui
1:51:57 PM: Caching artifacts
1:51:57 PM: Started saving node modules
1:51:57 PM: Finished saving node modules
1:51:57 PM: Started saving build plugins
1:51:57 PM: Finished saving build plugins
1:51:57 PM: Started saving pip cache
1:51:57 PM: Finished saving pip cache
1:51:57 PM: Started saving emacs cask dependencies
1:51:57 PM: Finished saving emacs cask dependencies
1:51:57 PM: Started saving maven dependencies
1:51:58 PM: Failed during stage 'building site': Build script returned non-zero exit code: 2 (https://ntl.fyi/exit-code-2)
1:51:57 PM: Finished saving maven dependencies
1:51:57 PM: Started saving boot dependencies
1:51:57 PM: Finished saving boot dependencies
1:51:57 PM: Started saving rust rustup cache
1:51:57 PM: Finished saving rust rustup cache
1:51:57 PM: Started saving go dependencies
1:51:57 PM: Finished saving go dependencies
1:51:58 PM: Build failed due to a user error: Build script returned non-zero exit code: 2
1:51:58 PM: Failing build: Failed to build site
1:51:58 PM: Finished processing build request in 30.452339066s

Yarn Install fails due to non existing file

I am deploying a site to netlify.
The site deployed fine until I installed react-player using npm install react-player
There were a number of critical errors that I tried to fix.
The site builds fine locally using yarn run build and it runs fine locally doing npm start.
But when I deploy it to netlify I get an error with Yarn Install that shows the following
5:21:48 AM: Build ready to start
5:21:50 AM: build-image version: 73def8bb10593b9b818f44989a75ea508018ccb7 (focal)
5:21:50 AM: build-image tag: v4.5.2
5:21:50 AM: buildbot version: 8cd320132979d1a1a502e85e77b47b97cc7d659f
5:21:50 AM: Fetching cached dependencies
5:21:50 AM: Starting to download cache of 237.2MB
5:21:52 AM: Finished downloading cache in 2.467525285s
5:21:52 AM: Starting to extract cache
5:22:00 AM: Finished extracting cache in 7.81313843s
5:22:00 AM: Finished fetching cache in 10.326357005s
5:22:00 AM: Starting to prepare the repo for build
5:22:01 AM: Preparing Git Reference refs/heads/main
5:22:02 AM: Parsing package.json dependencies
5:22:03 AM: Starting build script
5:22:03 AM: Installing dependencies
5:22:03 AM: Python version set to 2.7
5:22:03 AM: Started restoring cached node version
5:22:05 AM: Finished restoring cached node version
5:22:05 AM: v16.13.2 is already installed.
5:22:06 AM: Now using node v16.13.2 (npm v8.1.2)
5:22:06 AM: Started restoring cached build plugins
5:22:06 AM: Finished restoring cached build plugins
5:22:06 AM: Attempting ruby version 2.7.2, read from environment
5:22:07 AM: Using ruby version 2.7.2
5:22:07 AM: Using PHP version 8.0
5:22:07 AM: Started restoring cached yarn cache
5:22:12 AM: Finished restoring cached yarn cache
5:22:13 AM: No yarn workspaces detected
5:22:13 AM: Started restoring cached node modules
5:22:13 AM: Finished restoring cached node modules
5:22:13 AM: Installing NPM modules using Yarn version 1.22.10
5:22:14 AM: yarn install v1.22.10
5:22:14 AM: warning package-lock.json found. Your project contains lock files generated by tools other than Yarn. It is advised not to mix package managers in order to avoid resolution inconsistencies caused by unsynchronized lock files. To clear this warning, remove package-lock.json.
5:22:14 AM: [1/4] Resolving packages...
5:22:15 AM: warning react-scripts > fsevents#2.1.2: "Please update to latest v2.3 or v2.2"
5:22:15 AM: warning react-scripts > webpack-dev-server > chokidar > fsevents#1.2.13: fsevents 1 will break on node v14+ and could be using insecure binaries. Upgrade to fsevents 2.
5:22:15 AM: warning react-scripts > babel-jest > #jest/transform > jest-haste-map > fsevents#1.2.13: fsevents 1 will break on node v14+ and could be using insecure binaries. Upgrade to fsevents 2.
5:22:15 AM: error Package "chokidar2" refers to a non-existing file '"/opt/build/repo/chokidar2"'.
5:22:15 AM: info Visit https://yarnpkg.com/en/docs/cli/install for documentation about this command.
5:22:15 AM: Error during Yarn install
5:22:15 AM: Build was terminated: Build script returned non-zero exit code: 1
5:22:15 AM: Creating deploy upload records
5:22:15 AM: Failing build: Failed to build site
5:22:15 AM: Failed during stage 'building site': Build script returned non-zero exit code: 1
5:22:15 AM: Finished processing build request in 25.380006101s
I am not sure how to approach solving this error. I have checked a number of similar posts such as npm install fails, yarn install succeeds on netlify deploy but I am not finding a good solution.
Thanks for your help
the issue was in the yarn.lock file. It was referring to chokidar2 which was not working.
I removed the yarn.lock file and my node modules folder.
Then I ran yarn cache clean
then I reran yarn install to reinstall node modules
Then I ran yarn run build
and reuploaded everything to git with the new build

Problem with gatsby: command not found when deploying gatsby site to netlify

I was trying to deploy gatsby site to Netlify. I commit all files from public directory within gatsby project to my github repository and then deploy that repository on netlify, but I got an error.
After pushing to github all files and directories except for public and then deploy I got following error:
12:23:37 PM: ​
12:23:37 PM: ┌─────────────────────────────┐
12:23:37 PM: │ Netlify Build │
12:23:37 PM: └─────────────────────────────┘
12:23:37 PM: ​
12:23:37 PM: ❯ Version
12:23:37 PM: #netlify/build 3.3.0
12:23:37 PM: ​
12:23:37 PM: ❯ Flags
12:23:37 PM: deployId: 5f4637d3e090c2ab4a26309c
12:23:37 PM: mode: buildbot
12:23:37 PM: ​
12:23:37 PM: ❯ Current directory
12:23:37 PM: /opt/build/repo
12:23:37 PM: ​
12:23:37 PM: ❯ Config file
12:23:37 PM: No config file was defined: using default values.
12:23:37 PM: ​
12:23:37 PM: ❯ Context
12:23:37 PM: production
12:23:37 PM: ​
12:23:37 PM: ┌───────────────────────────────────┐
12:23:37 PM: │ 1. Build command from Netlify app │
12:23:37 PM: └───────────────────────────────────┘
12:23:37 PM: ​
12:23:37 PM: $ gatsby build
12:23:40 PM: success open and validate gatsby-configs - 0.022s
12:23:40 PM: success load plugins - 0.498s
12:23:40 PM: success onPreInit - 0.040s
12:23:40 PM: success delete html and css files from previous builds - 0.002s
12:23:40 PM: success initialize cache - 0.006s
12:23:41 PM: success copy gatsby files - 0.028s
12:23:41 PM: success onPreBootstrap - 0.005s
12:23:41 PM: success createSchemaCustomization - 0.006s
12:23:41 PM: success Checking for changed pages - 0.000s
12:23:41 PM: success source and transform nodes - 0.086s
12:23:41 PM: success building schema - 0.271s
12:23:41 PM: success createPages - 0.001s
12:23:41 PM: success Checking for changed pages - 0.000s
12:23:41 PM: success createPagesStatefully - 0.067s
12:23:41 PM: success update schema - 0.023s
12:23:41 PM: success onPreExtractQueries - 0.001s
12:23:43 PM: success extract queries from components - 2.444s
12:23:43 PM: success write out redirect data - 0.001s
12:23:43 PM: success onPostBootstrap - 0.000s
12:23:43 PM: info bootstrap finished - 6.517s
12:23:44 PM: success run static queries - 0.017s - 1/1 60.34/s
12:23:44 PM: success run page queries - 0.004s - 1/1 241.80/s
12:23:44 PM: success write out requires - 0.004s
12:24:11 PM: success Building production JavaScript and CSS bundles - 27.400s
12:24:11 PM: success Rewriting compilation hashes - 0.002s
12:24:15 PM: failed Building static HTML for pages - 3.641s
12:24:15 PM: error "document" is not available during server side rendering.
12:24:15 PM:
12:24:15 PM: > 1 | !function(e,t){"object"==typeof exports&&"object"==typeof module?module.exports=t():"function"==typeof define&&define.amd?define([],t):"object"==typeof exports?exports.AOS=t():e.AOS=t()}(this,function(){return function(e){function t(o){if(n[o])return n[o].exports;var i=n[o]={exports:{},id:o,loaded:!1};return e[o].call(i.exports,i,i.exports,t),i.loaded=!0,i.exports}var n={};return t.m=e,t.c=n,t.p="dist/",t(0)}([function(e,t,n){"use strict";function o(e){return e&&e.__esModule?e:{default:e}}var i=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var o in n)Object.prototype.hasOwnProperty.call(n,o)&&(e[o]=n[o])}return e},r=n(1),a=(o(r),n(6)),u=o(a),c=n(7),s=o(c),f=n(8),d=o(f),l=n(9),p=o(l),m=n(10),b=o(m),v=n(11),y=o(v),g=n(14),h=o(g),w=[],k=!1,x={offset:120,delay:0,easing:"ease",duration:400,disable:!1,once:!1,startEvent:"DOMContentLoaded",throttleDelay:99,debounceDelay:50,disableMutationObserver:!1},j=function(){var e=arguments.length>0&&void
12:24:15 PM: | ^
12:24:15 PM:
12:24:15 PM: WebpackError: ReferenceError: document is not defined
12:24:15 PM:
12:24:15 PM: - aos.js:1
12:24:15 PM: node_modules/aos/dist/aos.js:1:14565
12:24:15 PM:
12:24:15 PM: - aos.js:1
12:24:15 PM: node_modules/aos/dist/aos.js:1:1506
12:24:15 PM:
12:24:15 PM: - Technologie.js:8
12:24:15 PM: src/components/Technologie.js:8:5
12:24:15 PM:
12:24:15 PM: - index.js:1
12:24:15 PM: src/pages/index.js:1:1
12:24:15 PM:
12:24:15 PM: - getLayoutRect.js:1
12:24:15 PM: node_modules/#popperjs/core/lib/dom-utils/getLayoutRect.js:1:1
12:24:15 PM:
12:24:15 PM:
12:24:15 PM: ​
12:24:15 PM: ┌─────────────────────────────┐
12:24:15 PM: │ "build.command" failed │
12:24:15 PM: └─────────────────────────────┘
12:24:15 PM: ​
12:24:15 PM: Error message
12:24:15 PM: Command failed with exit code 1: gatsby build
12:24:15 PM: ​
12:24:15 PM: Error location
12:24:15 PM: In Build command from Netlify app:
12:24:15 PM: gatsby build
12:24:15 PM: ​
12:24:15 PM: Resolved config
12:24:15 PM: build:
12:24:15 PM: command: gatsby build
12:24:15 PM: commandOrigin: ui
12:24:15 PM: publish: /opt/build/repo/public
12:24:15 PM: Caching artifacts
12:24:15 PM: Started saving node modules
12:24:15 PM: Finished saving node modules
12:24:15 PM: Started saving build plugins
12:24:15 PM: Finished saving build plugins
12:24:15 PM: Started saving pip cache
12:24:15 PM: Finished saving pip cache
12:24:15 PM: Started saving emacs cask dependencies
12:24:15 PM: Finished saving emacs cask dependencies
12:24:15 PM: Started saving maven dependencies
12:24:15 PM: Finished saving maven dependencies
12:24:15 PM: Started saving boot dependencies
12:24:15 PM: Finished saving boot dependencies
12:24:15 PM: Started saving go dependencies
12:24:15 PM: Finished saving go dependencies
12:24:18 PM: Error running command: Build script returned non-zero exit code: 1
12:24:18 PM: Failing build: Failed to build site
12:24:18 PM: Failed during stage 'building site': Build script returned non-zero exit code: 1
12:24:19 PM: Finished processing build request in 2m5.540557721s
Any suggestions? Thanks in advance.
There's a process misunderstanding there. In your repository, you should commit all files except your /public folder since it's the one that will be generated in the building and deploy process in Netlify. In addition, your netlify.toml is not adding any useful command to Netlify because they are added by default in the dashboard. As you can see in:
Note: you can find this configuration under https://app.netlify.com/sites/YOUR_PROJECT_NAME/settings/deploys
Your command is failing because you are doing the Netlify work in your repository. You are uploading a built folder (/public) that doesn't contain any package.json nor build commands so your command is unrecognized.
You must upload all files except your /public folder in your repository and let Netlify do the build process. In addition, you can improve your netlify.toml by removing the default commands.
With the new edited content it's inferred that
this build must fail locally too before pushing it to Netlify. In Gatsby, you have to check for the availability of the global objects (like window or document before using it).
It's a broad question and spreads the topic of it. If the error is in your code (you are using document object) you need to add a condition first:
If (typeof document !== 'undefined') {
//Your code here
}
If the error comes from an external source (library or dependency using window or document internally), you need to add a null loader in your webpack's configuration:
exports.onCreateWebpackConfig = ({ stage, loaders, actions }) => {
if (stage === "build-html") {
actions.setWebpackConfig({
module: {
rules: [
{
test: /bad-module/,
use: loaders.null(),
},
],
},
})
}
}
Replacing /bad-module/ for the library path in node_modules.
You can check for further details in Debugging HTML Builds Documentation
To add properly AOS package add this to your page/component:
componentDidMount() {
const AOS = require('aos');
this.aos = AOS this.aos.init()
}
componentDidUpdate() {
this.aos.refresh()
}
Or using hooks:
let AOS;
useEffect(() => {
/** * Server-side rendering does not provide the 'document' object
* therefore this import is required either in useEffect or componentDidMount as they
* are exclusively executed on a client */
const AOS = require("aos");
AOS.init({ once: true, }); }, []);
useEffect(() => { if (AOS) { AOS.refresh(); } });

latest changes not showing on Netlify after deployment

This is my first time deploying a react js app to Netlify and I'm facing some issues.
every time I try to push new commits to GitHub Netlify automatically deploys it but the changes don't seem to take effect for some reason.
Here's the deployment log:
2:03:20 PM: Waiting for other deploys from your team to complete
2:03:41 PM: Build ready to start
2:03:43 PM: build-image version: ca811f47d4c1cbd1812d1eb6ecb0c977e86d1a1d
2:03:43 PM: build-image tag: v3.3.20
2:03:43 PM: buildbot version: be8ecf2af866e16fa4301cc5c14de2ccbbb21cf4
2:03:43 PM: Fetching cached dependencies
2:03:43 PM: Starting to download cache of 114.5MB
2:03:45 PM: Finished downloading cache in 1.515845861s
2:03:45 PM: Starting to extract cache
2:03:50 PM: Finished extracting cache in 5.156934064s
2:03:50 PM: Finished fetching cache in 6.69538965s
2:03:50 PM: Starting to prepare the repo for build
2:03:50 PM: Preparing Git Reference refs/heads/master
2:03:52 PM: Different publish path detected, going to use the one specified in the Netlify configuration file: 'build' versus 'build/' in the Netlify UI
2:03:52 PM: Starting build script
2:03:52 PM: Installing dependencies
2:03:52 PM: Python version set to 2.7
2:03:52 PM: Started restoring cached node version
2:03:55 PM: Finished restoring cached node version
2:03:55 PM: v12.18.0 is already installed.
2:03:56 PM: Now using node v12.18.0 (npm v6.14.4)
2:03:56 PM: Started restoring cached build plugins
2:03:56 PM: Finished restoring cached build plugins
2:03:56 PM: Attempting ruby version 2.7.1, read from environment
2:03:57 PM: Using ruby version 2.7.1
2:03:57 PM: Using PHP version 5.6
2:03:57 PM: 5.2 is already installed.
2:03:57 PM: Using Swift version 5.2
2:03:57 PM: Started restoring cached node modules
2:03:57 PM: Finished restoring cached node modules
2:03:58 PM: Started restoring cached go cache
2:03:58 PM: Finished restoring cached go cache
2:03:58 PM: go version go1.14.4 linux/amd64
2:03:58 PM: go version go1.14.4 linux/amd64
2:03:58 PM: Installing missing commands
2:03:58 PM: Verify run directory
2:03:59 PM: ​
2:03:59 PM: ┌─────────────────────────────┐
2:03:59 PM: │ Netlify Build │
2:03:59 PM: └─────────────────────────────┘
2:03:59 PM: ​
2:03:59 PM: ❯ Version
2:03:59 PM: #netlify/build 3.0.1
2:03:59 PM: ​
2:03:59 PM: ❯ Flags
2:03:59 PM: deployId: 5f16bd6759d4ae00096bdb64
2:03:59 PM: mode: buildbot
2:03:59 PM: ​
2:03:59 PM: ❯ Current directory
2:03:59 PM: /opt/build/repo
2:03:59 PM: ​
2:03:59 PM: ❯ Config file
2:03:59 PM: No config file was defined: using default values.
2:03:59 PM: ​
2:03:59 PM: ❯ Context
2:03:59 PM: production
2:03:59 PM: ​
2:03:59 PM: ┌───────────────────────────────────┐
2:03:59 PM: │ 1. Build command from Netlify app │
2:03:59 PM: └───────────────────────────────────┘
2:03:59 PM: ​
2:03:59 PM: $ npm run
2:03:59 PM: Lifecycle scripts included in cortex_app:
2:03:59 PM: start
2:03:59 PM: react-scripts start
2:03:59 PM: test
2:03:59 PM: react-scripts test
2:03:59 PM: available via `npm run-script`:
2:03:59 PM: build
2:03:59 PM: react-scripts build
2:03:59 PM: eject
2:03:59 PM: react-scripts eject
2:03:59 PM: ​
2:03:59 PM: (build.command completed in 303ms)
2:03:59 PM: ​
2:03:59 PM: ┌─────────────────────────────┐
2:03:59 PM: │ Netlify Build Complete │
2:03:59 PM: └─────────────────────────────┘
2:03:59 PM: ​
2:03:59 PM: (Netlify Build completed in 322ms)
2:03:59 PM: Caching artifacts
2:03:59 PM: Started saving node modules
2:03:59 PM: Finished saving node modules
2:03:59 PM: Started saving build plugins
2:03:59 PM: Finished saving build plugins
2:03:59 PM: Started saving pip cache
2:03:59 PM: Finished saving pip cache
2:03:59 PM: Started saving emacs cask dependencies
2:03:59 PM: Finished saving emacs cask dependencies
2:03:59 PM: Started saving maven dependencies
2:03:59 PM: Finished saving maven dependencies
2:03:59 PM: Started saving boot dependencies
2:03:59 PM: Finished saving boot dependencies
2:03:59 PM: Started saving go dependencies
2:03:59 PM: Finished saving go dependencies
2:03:59 PM: Build script success
2:03:59 PM: Starting to deploy site from 'build'
2:03:59 PM: Creating deploy tree
2:03:59 PM: Creating deploy upload records
2:03:59 PM: 0 new files to upload
2:03:59 PM: 0 new functions to upload
2:03:59 PM: Starting post processing
2:03:59 PM: Post processing - HTML
2:04:00 PM: Post processing - redirect rules
2:04:00 PM: Post processing - header rules
2:04:00 PM: Post processing done
2:04:00 PM: Site is live
2:04:19 PM: Finished processing build request in 36.032433755s
the latest commit is 9421ef1 and the changes are visible on the GitHub repo. so what might be the problem in case somebody else was facing a similar issue?
It looks like your netlify build command is set to npm run, that needs to be npm run build for Netlify to know how to build your React app into a production site.
You can change that in your netlify.toml or in your Build Settings on the Netlify website.

File structure and scripts for deploying next js app to netlify

Pretty new to useing Next JS and combined information from various tutorials, but stuck on what I am doing wrong with either file structure or the build process in general in order to have a successful deployment to Netlify.
In the nextjs tutorial they have you put pages in /pages directory at the root. But most tutorials with webpack have you put them in another directory, the /src. well for now I don't need to worry about webpack and just want to deploy the site.
Followed this tutorial https://medium.com/#azizhk/next-js-netlify-c246ea070ae2
in my package.json i have
"scripts": {
"dev": "next",
"build": "next build && next export",
"start": "serve ./out"
},
My Build Settings in Netlify
Where the build went wrong
6:32:04 PM: Error running command: Build script returned non-zero exit code: 127
6:32:04 PM: Failing build: Failed to build site
6:32:04 PM: failed during stage 'building site': Build script returned non-zero exit code: 127
Updated directory structure
Full notes of errors from build
6:31:16 PM: Build ready to start
6:31:30 PM: build-image version: 9e0f207a27642d0115b1ca97cd5e8cebbe492f63
6:31:30 PM: build-image tag: v3.3.2
6:31:30 PM: buildbot version: 8727aab446158e7b8c8ad2e96fe74b0154505a4e
6:31:30 PM: Fetching cached dependencies
6:31:31 PM: Starting to download cache of 2.0MB
6:31:31 PM: Finished downloading cache in 158.159923ms
6:31:31 PM: Starting to extract cache
6:31:31 PM: Finished extracting cache in 24.261695ms
6:31:31 PM: Finished fetching cache in 184.056316ms
6:31:31 PM: Starting to prepare the repo for build
6:31:31 PM: Preparing Git Reference refs/heads/master
6:31:32 PM: Starting build script
6:31:32 PM: Installing dependencies
6:31:33 PM: Downloading and installing node v10.16.3...
6:31:34 PM: Downloading https://nodejs.org/dist/v10.16.3/node-v10.16.3-linux-x64.tar.xz...
6:31:34 PM:
######################
6:31:34 PM: 31.2%
6:31:34 PM:
##################################################################
6:31:34 PM: 92.1%
6:31:34 PM:
########################################################################
6:31:34 PM: 100.0%
6:31:34 PM: Computing checksum with sha256sum
6:31:34 PM: Checksums matched!
6:31:38 PM: Now using node v10.16.3 (npm v6.9.0)
6:31:38 PM: Attempting ruby version 2.6.2, read from environment
6:31:39 PM: Using ruby version 2.6.2
6:31:39 PM: Using PHP version 5.6
6:31:39 PM: Started restoring cached node modules
6:31:39 PM: Finished restoring cached node modules
6:31:40 PM: Installing NPM modules using NPM version 6.9.0
6:31:59 PM: > core-js#2.6.10 postinstall /opt/build/repo/node_modules/core-js
6:31:59 PM: > node postinstall || echo "ignore"
6:31:59 PM: Thank you for using core-js ( https://github.com/zloirock/core-js ) for polyfilling JavaScript standard library!
6:31:59 PM: The project needs your help! Please consider supporting of core-js on Open Collective or Patreon:
6:31:59 PM: > https://opencollective.com/core-js
6:31:59 PM: > https://www.patreon.com/zloirock
6:31:59 PM: Also, the author of core-js ( https://github.com/zloirock ) is looking for a good job -)
6:31:59 PM: > styled-components#4.4.0 postinstall /opt/build/repo/node_modules/styled-components
6:31:59 PM: > node ./scripts/postinstall.js || exit 0
6:31:59 PM: Use styled-components at work? Consider supporting our development efforts at https://opencollective.com/styled-components
6:32:00 PM: npm WARN
6:32:00 PM: cityguide#1.0.0 No description
6:32:00 PM: npm WARN cityguide#1.0.0 No repository field.
6:32:00 PM: npm
6:32:00 PM: WARN optional SKIPPING OPTIONAL DEPENDENCY: fsevents#1.2.9 (node_modules/fsevents):
6:32:00 PM: npm WARN
6:32:00 PM: notsup SKIPPING OPTIONAL DEPENDENCY: Unsupported platform for fsevents#1.2.9: wanted {"os":"darwin","arch":"any"} (current: {"os":"linux","arch":"x64"})
6:32:00 PM: added 1014 packages from 493 contributors and audited 19416 packages in 19.734s
6:32:00 PM: found 0 vulnerabilities
6:32:00 PM: NPM modules installed
6:32:01 PM: Started restoring cached go cache
6:32:01 PM: Finished restoring cached go cache
6:32:01 PM: unset GOOS;
6:32:01 PM: unset GOARCH;
6:32:01 PM: export GOROOT='/opt/buildhome/.gimme/versions/go1.12.linux.amd64';
6:32:01 PM: export PATH="/opt/buildhome/.gimme/versions/go1.12.linux.amd64/bin:${PATH}";
6:32:01 PM: go version >&2;
6:32:01 PM: export GIMME_ENV='/opt/buildhome/.gimme/env/go1.12.linux.amd64.env';
6:32:01 PM: go version go1.12 linux/amd64
6:32:01 PM: Installing missing commands
6:32:01 PM: Verify run directory
6:32:01 PM: Executing user command: yarn build
6:32:01 PM: /usr/local/bin/build: line 60: yarn: command not found
6:32:01 PM: Skipping functions preparation step: no functions directory set
6:32:01 PM: Caching artifacts
6:32:01 PM: Started saving node modules
6:32:01 PM: Finished saving node modules
6:32:01 PM: Started saving pip cache
6:32:01 PM: Finished saving pip cache
6:32:01 PM: Started saving emacs cask dependencies
6:32:01 PM: Finished saving emacs cask dependencies
6:32:01 PM: Started saving maven dependencies
6:32:01 PM: Finished saving maven dependencies
6:32:01 PM: Started saving boot dependencies
6:32:01 PM: Finished saving boot dependencies
6:32:01 PM: Started saving go dependencies
6:32:01 PM: Finished saving go dependencies
6:32:04 PM: Error running command: Build script returned non-zero exit code: 127
6:32:04 PM: Failing build: Failed to build site
6:32:04 PM: failed during stage 'building site': Build script returned non-zero exit code: 127
6:32:04 PM: Finished processing build request in 33.478673773s
You can use below script to deploy your app in netlify
"scripts": {
"dev": "next",
"build": "next build",
"start": "next start",
"export": "next export",
"deploy": "yarn run build && yarn run export"
},
Here are netlify build settings.
If you are using npm then please write npm instead of yarn.

Resources