0
'REACT_APP_BUILD_ENV' is not recognized as an internal or external command,
operable program or batch file.
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! argon-dashboard-pro-react@1.2.0 build: `react-csp dev && REACT_APP_BUILD_ENV='test' react-scripts build && gulp licenses`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the argon-dashboard-pro-react@1.2.0 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\Shubham Jayswal\AppData\Roaming\npm-cache\_logs\2022-03-22T13_44_53_411Z-debug.log

I am trying to build my code but when I run npm run build with react project getting every time error, stuck there don't have an idea how to resolve that error, could please give me solution how to fix that error.

I am using Windows.

  • 1
    try https://stackoverflow.com/a/60925376/8705343 – rahuuzz Mar 22 '22 at 13:58
  • `REACT_APP_BUILD_ENV='test'` This section of the command will not work on Windows. Install the `cross-env` npm package: `npm install --save-dev cross-env` Change that part of the command to `cross-env REACT_APP_BUILD_ENV='test'` – Sean Norwood Mar 22 '22 at 13:59

1 Answers1

0

if on windows change build in package.json to react-csp dev && set REACT_APP_BUILD_ENV='test' react-scripts build && gulp licenses

  • Yes already added that please check it: "build": "REACT_APP_BUILD_ENV='test' react-scripts build && gulp licenses" – subham indapoint Mar 22 '22 at 14:01
  • You are missing the word 'set' @subhamindapoint – rahuuzz Mar 22 '22 at 14:05
  • I have added: "build": "set REACT_APP_BUILD_ENV='test' react-scripts build && gulp licenses", Getting another error. – subham indapoint Mar 22 '22 at 14:13
  • $ npm run build > argon-dashboard-pro-react@1.2.0 build C:\Users\Shubham Jayswal\Desktop\admin-panel > set REACT_APP_BUILD_ENV='test' react-scripts build && gulp licenses [19:39:59] Using gulpfile ~\Desktop\admin-panel\gulpfile.js [19:39:59] Starting 'licenses'... [19:39:59] Finished 'licenses' after 15 ms events.js:292 throw er; // Unhandled 'error' event ^ Error: File not found with singular glob: C:/Users/Shubham Jayswal/Desktop/admin-panel/build/index.html (if this was purposeful, use `allowEmpty` option) at Glob......... – subham indapoint Mar 22 '22 at 14:15