1

Netlify and Vercel both would refuse to deploy if there is a tiny warning, with the error message:

Treating warnings as errors because process.env.CI = true.

and so the solution is:

How to prevent Netlify from treating warnings as errors because process.env.CI = true?

override the build command with:

CI=false npm run build

or

CI= npm run build

what do they mean? Aren't they just setting the environment variable CI and not really a "command"?

nonopolarity
  • 146,324
  • 131
  • 460
  • 740
  • Does this answer your question? [strange variable definition in shell script](https://stackoverflow.com/questions/25195544/strange-variable-definition-in-shell-script) – jonrsharpe Mar 16 '21 at 16:43
  • or CI='' npm run build – nativelectronic Sep 29 '22 at 01:39
  • Does this answer your question? [Treating warnings as errors because process.env.CI = true. Failed to compile](https://stackoverflow.com/questions/62663451/treating-warnings-as-errors-because-process-env-ci-true-failed-to-compile) – revelt Mar 16 '23 at 16:58

2 Answers2

3

Just like the usage of

GREP_COLOR="1;32" grep foo bar.txt

so

CI=false npm run build

is to mean, set the environment variable CI to false and then under such condition, run the command npm run build.

nonopolarity
  • 146,324
  • 131
  • 460
  • 740
0

enter image description here

If you use webpack like me, you need add commands above. I hope that will be solution of your problems :)

user9399896
  • 27
  • 1
  • 7