Many libraries have behavior that should be different when run in a local machine compared to inside a CI. That’s because, as opposed to locally, the user is not interacting directly with the terminal. For example, interactive CLI output (progress bars, spinners, etc.) are typically shown differently in CI, or even hidden. This can be pretty important: for example, some libraries run in watch mode locally, but in CI, watch mode would make the build hang forever, so should not be used.
Every CI provider has its own set of environment variables to allow libraries to detect “Am I running inside this specific CI provider?”. For example, Netlify sets the
NETLIFY environment variable. But this makes it hard for libraries to detect “Am I running inside any CI provider?”. Although this is not an official standard (I believe), the
CI environment variables is the de-facto standard way to do this. It is often set to
true, although it is sometimes set to
Netlify was almost the only CI provider missing this variable, which made many libraries behave incorrectly. We fixed this few days ago.
create-react-app uses a stricter behavior when
CI is detected, where all warnings become errors (which was your problem). Unsetting
CI by prefixing
CI= is a workaround this specific issue.
If you are interesting into CI-related variables, the following libraries are also worth checking out:
Hope that helps!