node.js build fails if warnings present

Hello!

 

I have following configuration for pipeline:

 

image: node:latest

pipelines:
  default:
    - 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

1 vote

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!

Cheers,

Ana

 

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.

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?

Suggest an answer

Log in or Join to answer
Community showcase
Piotr Plewa
Published Dec 27, 2017 in Bitbucket

Recipe: Deploying AWS Lambda functions with Bitbucket Pipelines

Bitbucket Pipelines helps me manage and automate a number of serverless deployments to AWS Lambda and this is how I do it. I'm building Node.js Lambda functions using node-lambda&nbsp...

706 views 0 4
Read article

Atlassian User Groups

Connect with like-minded Atlassian users at free events near you!

Find a group

Connect with like-minded Atlassian users at free events near you!

Find my local user group

Unfortunately there are no AUG chapters near you at the moment.

Start an AUG

You're one step closer to meeting fellow Atlassian users at your local meet up. Learn more about AUGs

Groups near you
Atlassian Team Tour

Join us on the Team Tour

We're bringing product updates and pro tips on teamwork to ten cities around the world.

Save your spot