'npm ERR! [email protected] build: `CI= react-scripts build`

I have a basic reactjs app.
I want to deploy it to netlify. To deploy it on netlify, I need to build it first.
But when I run npm run build it throws following error.

My npm version is 6.14.8.

CI= react-scripts build

'CI' is not recognized as an internal or external command,
operable program or batch file.
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! [email protected] build: `CI= react-scripts build`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the [email protected] build script.
npm ERR! This is probably not a problem with npm. There is likely additional logging output above.

npm ERR! A complete log of this run can be found in:
npm ERR!     C:\Users\Amarjeet\AppData\Roaming\npm-cache\_logs\2021-01-17T11_18_13_129Z-debug.log


Solution 1:[1]

please go and open the package.json please find "build": "CI= react-scripts build" and change it to "build": "react-scripts build", then go and run npm run build again it should be ok

Solution 2:[2]

Go to the package.json file and do changes in the script object from "build" :"CI= react-scripts build" to "react-scripts build" , then run the command npm run build it will works.

Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source
Solution 1 manchit197
Solution 2 Swapnil Gole