Iβve got all my attempts at build failing this morning. I tried removing cache, etc. Branches that built yesterday fail this morning. I spent around 50 build minutes trying to figure out what is going on. I get failed with non zero exit code ,error location: In configuration "build.lifecycle.onBuild" command, npm run build.
Also, I tried switching to yarn and get yarn: not found
in Netlify. I picked successful builds and re run them and they all crash with either yarn or npm.
Try setting CI=false in the build command and check whether it works
Hey! Apologies in advance for the following copy/paste response. If I donβt clear anything up and/or your problem persists, please do reply.
This build may have failed because of the introduction of an unplanned change to builds in the last 24 hours. In your failed deploy log, you may see the line: Treating warnings as errors because process.env.CI = true
Basically, this change would mean that your site wonβt deploy if thereβs warnings. Although we plan to introduce this in some capacity in the future, like most other CI platforms already have, now wasnβt the time and weβve rolled this back.
TL;DR: if you re-deploy your site now, it should work! If not, please reply.
Thanks. Works for master, but any other branch preview build fails.
Update: works with npm, doesnβt with yarn
Hm β interesting! It sounds like a different issue, if Iβm being honest. Do you have a deploy log for this?
β¦
3:04:14 PM: β
3:04:14 PM: βββββββββββββββββββββββββββββββ
3:04:14 PM: β Netlify Build β
3:04:14 PM: βββββββββββββββββββββββββββββββ
3:04:14 PM: β
3:04:14 PM: β― Version
3:04:14 PM: @netlify/build 0.3.1
3:04:14 PM: β
3:04:14 PM: β― Flags
3:04:14 PM: mode: buildbot
3:04:14 PM: β
3:04:14 PM: β― Current directory
3:04:14 PM: /opt/build/repo
3:04:14 PM: β
3:04:14 PM: β― Config file
3:04:14 PM: /opt/build/repo/netlify.toml
3:04:14 PM: β
3:04:14 PM: β― Context
3:04:14 PM: branch-deploy
3:04:14 PM: β
3:04:15 PM: β― Loading plugins
3:04:15 PM: - @netlify/plugin-functions-core from build core
3:04:15 PM: βββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
3:04:15 PM: β 1. onPreBuild command from @netlify/plugin-functions-core β
3:04:15 PM: βββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
3:04:15 PM: β
3:04:15 PM: β
3:04:15 PM: (@netlify/plugin-functions-core onPreBuild completed in 4ms)
3:04:15 PM: ββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
3:04:15 PM: β 2. build.lifecycle.onBuild command from netlify.toml config file β
3:04:15 PM: ββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
3:04:15 PM: β
3:04:15 PM: $ yarn build
3:04:15 PM: /bin/sh: 1: yarn: not found
3:04:15 PM: β
3:04:15 PM: βββββββββββββββββββββββββββββββ
3:04:15 PM: β Build failed β
3:04:15 PM: βββββββββββββββββββββββββββββββ
3:04:15 PM: β
3:04:15 PM: β― Error message
3:04:15 PM: Command failed with exit code 127: yarn buildβ
3:04:15 PM: β
3:04:15 PM: β― Error location
3:04:15 PM: In configuration βbuild.lifecycle.onBuildβ command:
3:04:15 PM: yarn build
3:04:15 PM: β
3:04:16 PM: Caching artifacts
3:04:16 PM: Started saving node modules
3:04:16 PM: Finished saving node modules
3:04:16 PM: Started saving pip cache
3:04:16 PM: Finished saving pip cache
3:04:16 PM: Started saving emacs cask dependencies
3:04:16 PM: Finished saving emacs cask dependencies
3:04:16 PM: Started saving maven dependencies
3:04:16 PM: Finished saving maven dependencies
3:04:16 PM: Started saving boot dependencies
3:04:16 PM: Finished saving boot dependencies
3:04:16 PM: Started saving go dependencies
3:04:16 PM: Finished saving go dependencies
3:04:23 PM: Error running command: Build script returned non-zero exit code: 1
3:04:23 PM: Failing build: Failed to build site
3:04:23 PM: failed during stage βbuilding siteβ: Build script returned non-zero exit code: 1
3:04:23 PM: Finished processing build request in 1m38.006312466s
I see thereβs an exit code 127
error β Iβd suggest checking out this topic for some guidance!
Thanks for the tip. I finally managed to deploy now after 10 tries yesterday, and all kinds of debugging with sleep and false etc. Today I searched for βTreating warnings as errors because process.env.CI = trueβ and reached here and realized this was indeed the culprit.
Would have been good to give advance warning about this, rather than turning on unilaterally.
Hey @zehawk,
Understood and agreed. It wasnβt intentionally enabled and, rest assured, weβre usually loud and proud when it comes to improvements, changes and upgrades!