Search code examples
mavenjenkinsnpmbuildcontinuous-integration

Jenkins build fails with "Treating warnings as errors because of process.env.CI = true"


After updating the Jenkins, all builds started to fail with the following errors.

[ERROR] {some text}: {some text} is outdated. Please run next command `npm update`
[INFO] Treating warnings as errors because process.env.CI = true.
[INFO] Most CI servers set it automatically.

How can I fix this for all builds?


Solution

  • This is a result of this change:

    https://issues.jenkins.io/browse/JENKINS-36707

    It has introduced the standard CI env var that is always set to true in order to allow pipelines and tools to know they're executing in a continuous integration context.

    This has emerged as a best practice used by most other popular CI solutions, and a number of tools look for this variable in order to make CI-appropriate optimizations.

    You can set CI env variable to false through Manage Jenkins > Configure System > Global properties section. enter image description here

    Add a new env variable CI with the value false. enter image description here