"CLI for webpack must be installed"

I’m having trouble bundling my Node.js app with Webpack. When deploying, the Render console shows the error “CLI for webpack must be installed”.

My build command in the Render settings is defined as “npm install && npm run build”, and my build script in package.json is “webpack --config webpack.prod.js”. And yes, I have marked webpack, webpack-cli, along with other webpack plugins as devDependencies.

What am I doing wrong?

Solved: Render wasn’t installing Webpack because I had an environment variable NODE_ENV set to “production”, therefore no devDependencies were being installed.

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.