Getting the following error message while trying to run npm run build in root folder of react project:
PS D:\react> npm run build
> build
> node ./scripts/rollup/build-all-release-channels.js
BUILDING react.development.js (umd_dev)
COMPLETE react.development.js (umd_dev)
BUILDING react.production.min.js (umd_prod)
OH NOES! react.production.min.js (umd_prod)
-- PLUGIN_ERROR (scripts/rollup/plugins/closure-plugin) --
-rewrite_polyfills=false --inject_libraries=false --allow_dynamic_import=true --assume_function_wrapper=false --renaming=true --js=C:\Users\callm\AppData\Local\Temp\tmp-12140AroJhqjXfPIF
Process spawn error. Is java in the path?
spawn java ENOENT
at D:\react\scripts\rollup\plugins\closure-plugin.js:16:16
at ChildProcess.<anonymous> (D:\react\node_modules\google-closure-compiler\lib\node\closure-compiler.js:107:9)
at ChildProcess.emit (node:events:513:28)
at ChildProcess._handle.onexit (node:internal/child_process:289:12)
at onErrorNT (node:internal/child_process:476:16)
I was expecting to run build command smoothly without any errors so that we can go through fixtures and can work on react library issues.
How can I resolve this error?