title: Browserslist Error on Angular Build
body: <p>I have an Angular 4 app that recently started having issues on our build server. The Angular version is <code>^4.4.6</code> and the CLI version is <code>1.5.5</code>. Up until this week, there were no issues building the application on the build server, and we did not change any package versions. This build error occurs while a Docker image is being built on the build server. The application also builds just fine on my local machine. Here's an output of the errors, along with related package versions:</p>
  
  <p><a href="https://i.stack.imgur.com/SuYIZ.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/SuYIZ.png" alt="enter image description here"></a></p>
  
  <p>The raw output is:</p>
  
  <pre><code>ERROR in ./node_modules/raw-loader!./node_modules/postcss-loader/lib??embedded!./node_modules/sass-loader/lib/loader.js??ref--8-3!./src/styles.scss
  Module build failed: 
  @include caret;
          ^
      No mixin named caret
      in /usr/src/app/node_modules/bootstrap/scss/_dropdown.scss (line 11, column 12)
  ERROR in ./node_modules/raw-loader!./node_modules/postcss-loader/lib??embedded!./node_modules/material-design-iconic-font/dist/css/material-design-iconic-font.min.css
  Module build failed: BrowserslistError: Write any browsers query (for instance, `defaults`) before `not ie &lt;= 11`
      at /usr/src/app/node_modules/browserslist/index.js:139:15
      at Array.reduce (&lt;anonymous&gt;)
      at resolve (/usr/src/app/node_modules/browserslist/index.js:132:18)
      at browserslist (/usr/src/app/node_modules/browserslist/index.js:224:16)
      at Browsers.parse (/usr/src/app/node_modules/autoprefixer/lib/browsers.js:61:16)
      at new Browsers (/usr/src/app/node_modules/autoprefixer/lib/browsers.js:52:30)
      at loadPrefixes (/usr/src/app/node_modules/autoprefixer/lib/autoprefixer.js:70:24)
      at plugin (/usr/src/app/node_modules/autoprefixer/lib/autoprefixer.js:81:24)
      at LazyResult.run (/usr/src/app/node_modules/postcss/lib/lazy-result.js:277:20)
      at LazyResult.asyncTick (/usr/src/app/node_modules/postcss/lib/lazy-result.js:192:32)
      at /usr/src/app/node_modules/postcss/lib/lazy-result.js:197:27
      at &lt;anonymous&gt;
  ERROR in ./node_modules/raw-loader!./node_modules/postcss-loader/lib??embedded!./node_modules/animate.css/animate.min.css
  Module build failed: BrowserslistError: Write any browsers query (for instance, `defaults`) before `not ie &lt;= 11`
      at /usr/src/app/node_modules/browserslist/index.js:139:15
      at Array.reduce (&lt;anonymous&gt;)
      at resolve (/usr/src/app/node_modules/browserslist/index.js:132:18)
      at browserslist (/usr/src/app/node_modules/browserslist/index.js:224:16)
      at Browsers.parse (/usr/src/app/node_modules/autoprefixer/lib/browsers.js:61:16)
      at new Browsers (/usr/src/app/node_modules/autoprefixer/lib/browsers.js:52:30)
      at loadPrefixes (/usr/src/app/node_modules/autoprefixer/lib/autoprefixer.js:70:24)
      at plugin (/usr/src/app/node_modules/autoprefixer/lib/autoprefixer.js:81:24)
      at LazyResult.run (/usr/src/app/node_modules/postcss/lib/lazy-result.js:277:20)
      at LazyResult.asyncTick (/usr/src/app/node_modules/postcss/lib/lazy-result.js:192:32)
      at LazyResult.asyncTick (/usr/src/app/node_modules/postcss/lib/lazy-result.js:204:22)
      at LazyResult.asyncTick (/usr/src/app/node_modules/postcss/lib/lazy-result.js:204:22)
      at LazyResult.asyncTick (/usr/src/app/node_modules/postcss/lib/lazy-result.js:204:22)
      at /usr/src/app/node_modules/postcss/lib/lazy-result.js:197:27
      at &lt;anonymous&gt;
  ERROR in ./node_modules/raw-loader!./node_modules/postcss-loader/lib??embedded!./node_modules/nouislider/distribute/nouislider.min.css
  Module build failed: BrowserslistError: Write any browsers query (for instance, `defaults`) before `not ie &lt;= 11`
      at /usr/src/app/node_modules/browserslist/index.js:139:15
      at Array.reduce (&lt;anonymous&gt;)
      at resolve (/usr/src/app/node_modules/browserslist/index.js:132:18)
      at browserslist (/usr/src/app/node_modules/browserslist/index.js:224:16)
      at Browsers.parse (/usr/src/app/node_modules/autoprefixer/lib/browsers.js:61:16)
      at new Browsers (/usr/src/app/node_modules/autoprefixer/lib/browsers.js:52:30)
      at loadPrefixes (/usr/src/app/node_modules/autoprefixer/lib/autoprefixer.js:70:24)
      at plugin (/usr/src/app/node_modules/autoprefixer/lib/autoprefixer.js:81:24)
      at LazyResult.run (/usr/src/app/node_modules/postcss/lib/lazy-result.js:277:20)
      at LazyResult.asyncTick (/usr/src/app/node_modules/postcss/lib/lazy-result.js:192:32)
      at LazyResult.asyncTick (/usr/src/app/node_modules/postcss/lib/lazy-result.js:204:22)
      at LazyResult.asyncTick (/usr/src/app/node_modules/postcss/lib/lazy-result.js:204:22)
      at LazyResult.asyncTick (/usr/src/app/node_modules/postcss/lib/lazy-result.js:204:22)
      at /usr/src/app/node_modules/postcss/lib/lazy-result.js:197:27
      at &lt;anonymous&gt;
  ERROR in ./node_modules/raw-loader!./node_modules/postcss-loader/lib??embedded!./node_modules/dropzone/dist/min/dropzone.min.css
  Module build failed: BrowserslistError: Write any browsers query (for instance, `defaults`) before `not ie &lt;= 11`
      at /usr/src/app/node_modules/browserslist/index.js:139:15
      at Array.reduce (&lt;anonymous&gt;)
      at resolve (/usr/src/app/node_modules/browserslist/index.js:132:18)
      at browserslist (/usr/src/app/node_modules/browserslist/index.js:224:16)
      at Browsers.parse (/usr/src/app/node_modules/autoprefixer/lib/browsers.js:61:16)
      at new Browsers (/usr/src/app/node_modules/autoprefixer/lib/browsers.js:52:30)
      at loadPrefixes (/usr/src/app/node_modules/autoprefixer/lib/autoprefixer.js:70:24)
      at plugin (/usr/src/app/node_modules/autoprefixer/lib/autoprefixer.js:81:24)
      at LazyResult.run (/usr/src/app/node_modules/postcss/lib/lazy-result.js:277:20)
      at LazyResult.asyncTick (/usr/src/app/node_modules/postcss/lib/lazy-result.js:192:32)
      at LazyResult.asyncTick (/usr/src/app/node_modules/postcss/lib/lazy-result.js:204:22)
      at LazyResult.asyncTick (/usr/src/app/node_modules/postcss/lib/lazy-result.js:204:22)
      at LazyResult.asyncTick (/usr/src/app/node_modules/postcss/lib/lazy-result.js:204:22)
      at /usr/src/app/node_modules/postcss/lib/lazy-result.js:197:27
      at &lt;anonymous&gt;
  </code></pre>
  
  <p>The frustrating thing is that locally I've checked the version of bootstrap and what's installed in the <code>node_modules</code> folder, for example, and the file that it references, <code>_dropdown.scss</code> isn't trying to use a mixin called <code>caret</code> at all.</p>
  
  <p>Again, I'm not seeing these issues when building for any environment locally, only on the build server, inside a TeamCity container. I've tried changing the <code>package.json</code> to install specific versions of packages as well, but to no avail.</p>
  
  <p>Is there a way to debug this and determine exactly what version of the packages are being installed and how to fix the errors?</p>
  
  <h2>Edit</h2>
  
  <p>I added up above the note that this error happens while I'm building a Docker image for this app. The Dockerfile is as follows:</p>
  
  <pre><code>FROM johnpapa/angular-cli as angular-build
  WORKDIR /usr/src/app
  COPY package.json package.json
  RUN npm install --silent
  # RUN npm install typescript@'&gt;=2.1.0 &lt;2.4.0'
  COPY . .
  RUN ng build --env=test
  
  FROM nginx:alpine
  LABEL author="Preston Lamb"
  COPY nginx.conf /etc/nginx/nginx.conf
  COPY --from=angular-build /usr/src/app/dist /usr/share/nginx/html
  EXPOSE 80 443
  ENTRYPOINT [ "nginx", "-g", "daemon off;" ]
  </code></pre>