Problem
I just spent half a day trying to figure out, why trying to build an Angular project in Docker failed. I've followed the advice at Best Practices, not aware, that setting NODE_ENV to production causes npm not to install devDependencies.
Solution
The Best Practices guide should differentiate between using Node.js to build a Node.js based project (NODE_ENV=development) and to run a Node.js based project (NODE_ENV=production). Both can even be combined using multi-stage builds.
Problem
I just spent half a day trying to figure out, why trying to build an Angular project in Docker failed. I've followed the advice at Best Practices, not aware, that setting
NODE_ENVtoproductioncausesnpmnot to installdevDependencies.Solution
The Best Practices guide should differentiate between using Node.js to build a Node.js based project (
NODE_ENV=development) and to run a Node.js based project (NODE_ENV=production). Both can even be combined using multi-stage builds.