I'm building two sites with the _s Theme by Automattic. I've had not problem running them locally by npm run dev, however, now I'm getting ready to deploy them and whenever I run npm run build, the build fails, producing the following error:
npm ERR! code ELIFECYCLE
npm ERR! errno 2
npm ERR! [email protected] build: `webpack --mode=production`
npm ERR! Exit status 2
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.
I thought that maybe it was something wrong with my code and implementation, however after downloading a fresh version of _s with Webpack from https://github.com/carrieforde/_s-with-webpack and installing it, I get the same error which leads me to believe it's system related.
Any help would be greatly appreciated, thanks.
I just tried building on
_s-with-webpackand I get the same error, but it actually builds successfully. It's likely complaining because there are linting errors. Do you happen to see anything like this above the output you posted above?If that's the case, you have two options:
Hoping this helps steer you in the right direction.