New CI=true build configuration, "Treating warnings as errors because process.env.CI = true"

Ah, that is true. I stand corrected.

I do think though, that when this was introduced, it should not have been set to true, at least for existing projects.

I’m confused by one point though: It’s an environment variable, so why can’t I override CI=true by setting CI in the build environment variable section?

Ran into this issue today as well. The proposed solution fixed it for me. Thanks guys.

1 Like

Perhaps just updating your support documentation or adding a console line item in the deployment log could be helpful. I’m sure I’m not the only one that was faced with this issue.

Thanks,
Scott Kutler

1 Like

Like Jacob, I had a lot of trouble with my project, and right now, I’m not happy with your services. I hope you will change the way that you inform your users and customers.

1 Like

Thanks for your feedback, @arash. We are definitely aware of the impact this has had on folks and are scheduling a learning sesh for this week to discuss. Are things working for you now, though? Just want to make sure.

Yeah, It’s working now.

2 Likes

i am lost , how do i do this: CI= npm run build. please share me a step by step guide. my application crashed after redeploying

Hey @gakin95,
I just took a look at your site and it seems like, while your screenshot includes the correct build command (CI= npm run build), your site no longer does (npm run build). Maybe you’ve changed the build command in the UI since posting? Try updating your build command and if you could drop us a link to the deploy after that, that’ll help us debug.

this screenshot fixed d problem

Hi, Just tried both methods (the toml and in the netlify ui) and I’m still crashing at the build step which is logging out this

10:07:34 PM:   Error message
10:07:34 PM:   Command failed with exit code 1: CI= npm run build
10:07:34 PM: ​
10:07:34 PM:   Error location
10:07:34 PM:   In build.command from netlify.toml:
10:07:34 PM:   CI= npm run build

Sorry to hear it @JeremyPittard! Could you share a link to your build logs in our UI, and also quote your netlify.toml for us? Our staff (and other customers who want to help) can’t see into your repos, generally speaking, so more info from you will be very helpful in debugging.

thanks, no worries
this is the most recent build log
https://app.netlify.com/sites/wafc/deploys/5ef215c7c1de600007358dcd

and the following is the entire netlify.toml file

[build]
  publish = "public"
  command = "CI= npm run build"
  functions = "lambda"
[build.environment]
  YARN_VERSION = "1.9.4"
  YARN_FLAGS = "--no-ignore-optional"

This broke my app. I then went and did the recommended fix and set the build command to CI= npm run build in settings. That solved my problem and I was able to deploy my app again.

Now, a couple days later, I’m getting an error again:

┌─────────────────────────────┐
8:16:52 PM: │ “build.command” failed │
8:16:52 PM: └─────────────────────────────┘
8:16:52 PM: ​
8:16:52 PM: Error message
8:16:52 PM: Command failed with exit code 1: CI= npm run build
8:16:52 PM: ​
8:16:52 PM: Error location
8:16:52 PM: In Build command from settings:
8:16:52 PM: CI= npm run build
8:16:52 PM: ​
8:16:52 PM: Resolved config
8:16:52 PM: build:
8:16:52 PM: command: CI= npm run build
8:16:52 PM: publish: /opt/build/repo/build

How do I fix this? CI= npm run build is still set in the settings but now I’m getting another error after this previously worked.

I just removed my .lock files and it now seems to work, thanks for reaching out though @fool

@nicknyr not sure, but this might also help your case

Hi, @nicknyr. The build command itself returned an error code.

The reason for the error will be in the logs above. It is unlikely that the current “exit code 1” is related to “CI= ” being used. The only way to tell though is for us to look at the full logs.

Would you please send us the deploy id where this happened? You can get the deploy id from the end of the page URL. For example for this deploy log URL:

https://app.netlify.com/sites/example/deploys/5ef40e69238887b256bc5758

The deploy id is 5ef40e69238887b256bc5758.

Or you can just send us the full URL if you prefer. If you do, we’ll take a look and let you know what we find.

I’ve seen a few other threads where I could post this, but I thought I’d post my question on this one.

I continue to have the following issue:
9:32:11 AM: Build ready to start
9:32:13 AM: build-image version: 3031d4c9e432fd7016f6279fc9ad706f9205d845
9:32:13 AM: build-image tag: v3.3.17
9:32:13 AM: buildbot version: 1f35b3abd6e2bf5230d8edf68072840fdec1513f
9:32:14 AM: Fetching cached dependencies
9:32:14 AM: Starting to download cache of 757.7KB
9:32:14 AM: Finished downloading cache in 103.702521ms
9:32:14 AM: Starting to extract cache
9:32:14 AM: Finished extracting cache in 30.887806ms
9:32:14 AM: Finished fetching cache in 135.904581ms
9:32:14 AM: Starting to prepare the repo for build
9:32:14 AM: Preparing Git Reference refs/heads/master
9:32:16 AM: Different publish path detected, going to use the one specified in the Netlify configuration file: ‘build’ versus ‘build/’ in the Netlify UI
9:32:16 AM: Starting build script
9:32:16 AM: Installing dependencies
9:32:16 AM: Python version set to 2.7
9:32:17 AM: v12.18.0 is already installed.
9:32:18 AM: Now using node v12.18.0 (npm v6.14.4)
9:32:18 AM: Started restoring cached build plugins
9:32:18 AM: Finished restoring cached build plugins
9:32:18 AM: Attempting ruby version 2.7.1, read from environment
9:32:21 AM: Using ruby version 2.7.1
9:32:21 AM: Using PHP version 5.6
9:32:21 AM: 5.2 is already installed.
9:32:21 AM: Using Swift version 5.2
9:32:21 AM: Started restoring cached go cache
9:32:21 AM: Finished restoring cached go cache
9:32:22 AM: go version go1.14.4 linux/amd64
9:32:22 AM: go version go1.14.4 linux/amd64
9:32:22 AM: Installing missing commands
9:32:22 AM: Verify run directory
9:32:23 AM: ​
9:32:23 AM: ┌─────────────────────────────┐
9:32:23 AM: │ Netlify Build │
9:32:23 AM: └─────────────────────────────┘
9:32:23 AM: ​
9:32:23 AM: ❯ Version
9:32:23 AM: @netlify/build 2.0.10
9:32:23 AM: ​
9:32:23 AM: ❯ Flags
9:32:23 AM: deployId: 5ef4c37b8f607b00076f4d27
9:32:23 AM: mode: buildbot
9:32:23 AM: ​
9:32:23 AM: ❯ Current directory
9:32:23 AM: /opt/build/repo
9:32:23 AM: ​
9:32:23 AM: ❯ Config file
9:32:23 AM: No config file was defined: using default values.
9:32:23 AM: ​
9:32:23 AM: ❯ Context
9:32:23 AM: production
9:32:23 AM: ​
9:32:23 AM: ┌────────────────────────────────┐
9:32:23 AM: │ 1. Build command from settings │
9:32:23 AM: └────────────────────────────────┘
9:32:23 AM: ​
9:32:23 AM: $ CI= npm run build
9:32:23 AM: npm ERR! code ENOENT
9:32:23 AM: npm ERR! syscall open
9:32:23 AM: npm ERR! path /opt/build/repo/package.json
9:32:23 AM: npm ERR! errno -2
9:32:23 AM: npm ERR! enoent ENOENT: no such file or directory, open ‘/opt/build/repo/package.json’
9:32:23 AM: npm ERR! enoent This is related to npm not being able to find a file.
9:32:23 AM: npm ERR! enoent
9:32:23 AM: npm ERR! A complete log of this run can be found in:
9:32:23 AM: npm ERR! /opt/buildhome/.npm/_logs/2020-06-25T15_32_23_804Z-debug.log
9:32:23 AM: ​
9:32:23 AM: ┌─────────────────────────────┐
9:32:23 AM: │ “build.command” failed │
9:32:23 AM: └─────────────────────────────┘
9:32:23 AM: ​
9:32:23 AM: Error message
9:32:23 AM: Command failed with exit code 254: CI= npm run build
9:32:23 AM: ​
9:32:23 AM: Error location
9:32:23 AM: In Build command from settings:
9:32:23 AM: CI= npm run build
9:32:23 AM: ​
9:32:23 AM: Resolved config
9:32:23 AM: build:
9:32:23 AM: command: CI= npm run build
9:32:23 AM: publish: /opt/build/repo/build
9:32:23 AM: Caching artifacts
9:32:23 AM: Started saving build plugins
9:32:23 AM: Finished saving build plugins
9:32:23 AM: Started saving pip cache
9:32:30 AM: Finished saving pip cache
9:32:30 AM: Started saving emacs cask dependencies
9:32:30 AM: Finished saving emacs cask dependencies
9:32:30 AM: Started saving maven dependencies
9:32:30 AM: Finished saving maven dependencies
9:32:30 AM: Started saving boot dependencies
9:32:30 AM: Finished saving boot dependencies
9:32:30 AM: Started saving go dependencies
9:32:31 AM: Finished saving go dependencies
9:32:33 AM: Error running command: Build script returned non-zero exit code: 1
9:32:33 AM: Failing build: Failed to build site
9:32:33 AM: Failed during stage ‘building site’: Build script returned non-zero exit code: 1
9:32:34 AM: Finished processing build request in 20.111730723s

I’ve tried utilizing a toml file with various commands I’ve found online. I’ve also tried using next-on-netlify npm. Whatever configuration I use though, I continue to see the same error above, with the exception of build command changing with whatever command I try and use. Any help would be appreciated.

The github repository can be located here: https://github.com/elchaparrito1/PFN/tree/master/pfn

I get the same error as @elchaparrito1 when I have CI= in my netlify.toml build command. To get around it I tried building locally but local builds don’t work with this in the toml so I have just removed it from the netlify.toml, disabled CI building on the netlify servers, and I just build and deploy from the CLI now on my PC. I would like to get back to automatic build and deploys from GitHub but I couldn’t get it working either.

CI= yarn build command is not working for me. Please let me know if you have any solution for this.