Trying to run webpack as part of my build step fails, gives an error that the cli isn’t installed. Using the shell and trying to install the webpack-cli manually results in:
CLI for webpack must be installed.
webpack-cli (https://github.com/webpack/webpack-cli)
We will use "npm" to install the CLI via "npm install -D webpack-cli".
Do you want to install 'webpack-cli' (yes/no): yes
Installing 'webpack-cli' (running 'npm install -D webpack-cli')...
npm ERR! code ENOLOCAL
npm ERR! Could not install from "node_modules/webpack-cli" as it does not contain a package.json file.
webpack-cli is part of my package.json file but isn’t being installed automatically.
Hey there- could you share with me what your build command looks like, and where your service is calling webpack initially? Please feel free to DM me if you’d prefer to not publicly post that on a forum.
My initial thought here is that it should use webpack rather than webpack-cli if it’s being called from something like a package.json build script, which should avoid the problem.
I think if you edit the Render build command to: npm install; npm run build
it will install dependencies prior to building. I had the same issue with webpack cli not installed and this fixed it for me.