Come for the products,
stay for the community

The Atlassian Community can help you and your team get more value out of Atlassian products and practices.

Atlassian Community about banner
Community Members
Community Events
Community Groups

node.js build fails if warnings present



I have following configuration for pipeline:


image: node:latest

    - step:
        script: # Modify the commands below to build your repository.
          - npm install
          - npm run build

Build fails if any warnings present.

Creating an optimized production build...
Failed to compile. When process.env.CI = true, warnings are treated as failures. Most CI servers set this automatically.

How to handle this?

1 answer

2 votes
Ana Retamal Atlassian Team Jun 01, 2017

Hi Varnav, the build is failing as warnings are being treated as errors due to a certain environment variable being set/not set. In this case, it looks from your error message like the affected variable is 'process.env.CI' (which is now set to true). You may need to set that to false in order to allow compiling to pass even in the face of warnings being raised.

Let us know if this solved your issue!




Setting CI to false does not help, but unsetting it does help. But, unfortunately, this also supresses all warnings.

Looks like this is a create-react-app issue.

Like Naoclis likes this

I am having a very tough time setting CI to false. Where do I do it from? I tried doing from Repo's environment variables , yet during my build run it is set as True.

I also tried doing it from the global settings at my team level or user level. Yet to no avail!

How do I set environment variable CI to false?

@varnav did you end up figuring out what the create-react-app issue was?

I am having the same issue during building, I wonder what solution you end up finding?

@Shikha Chugh try writing the following, before running npm build as

- unset CI 

- npm run build

This actually solved the issue for me

Like # people like this

"unset CI" worked for me and it still shows the warnings, which is what I wanted.

Thanks @soundar raj 

The following solution shared by the soundar raj wokred for me. 

- unset CI 

Suggest an answer

Log in or Sign up to answer
Community showcase
Published in Bitbucket

Git push size limits are coming to Bitbucket Cloud starting April 4th, 2022

Beginning on April 4th, we will be implementing push limits. This means that your push cannot be completed if it is over 3.5 GB. If you do attempt to complete a push that is over 3.5 GB, it will fail...

3,452 views 3 10
Read article

Atlassian Community Events