[Vuejs]-Docker build inconsistency for VueJS with GitlabCI

0👍

When run with an environment variable NODE_ENV set to production npm will not install packages listed as the "devDependencies". Quote from the official documentation:

With the –production flag (or when the NODE_ENV environment variable is set to production), npm will not install modules listed in devDependencies. To install all modules listed in both dependencies and devDependencies when NODE_ENV environment variable is set to production, you can use –production=false.

So, the solution to your problem would be either:

  • To move ENV NODE_ENV=${env} line a bit down, so it’s after the line with RUN npm install --progress=false,
  • To replace RUN npm install --progress=false with RUN npm install --progress=false --production=false (added --production=false flag).

Leave a comment