As I work on developing two websites using the _s Theme by Automattic, I have encountered an issue. While they run smoothly locally with npm run dev
, I face a problem when attempting to deploy them by running npm run build
. The build process fails every time, displaying the following error:
npm ERR! code ELIFECYCLE
npm ERR! errno 2
npm ERR! <a href="/cdn-cgi/l/email-protection" class="__cf_email__" data-cfemail="592c373d3c2b2a3a362b3c2a196877697769">[email protected]</a> build: `webpack --mode=production`
npm ERR! Exit status 2
npm ERR!
npm ERR! Failed at the <a href="/cdn-cgi/l/email-protection" class="__cf_email__" data-cfemail="2b5e454f4e59584844594e586b1a051b051b">[email protected]</a> build script.
npm ERR! This is probably not a problem with npm. There is likely additional logging output above.
I initially suspected an issue in my own code and implementation. However, even after downloading a fresh version of _s with Webpack from https://github.com/carrieforde/_s-with-webpack and installing it, the same error persists, leading me to believe it may be system-related.
If anyone can provide assistance, it would be greatly appreciated. Thank you.