Skip to content

Improve "Best Practices" regarding NODE_ENV #1453

Description

@mpoettgen

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.

Activity

  1. zWingz commented on Sep 26, 2021

    @zWingz

    setting NODE_ENV to production causes npm config production to be true
    image
    So, it would not install devDependencies

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions