title: Error when updating to Angular 11 from 8: Can't resolve 'util' in '/Users/foo/node_modules/request'
body: <p>I'm in the process of making a huge update to my Angular 8 project → Angular 11.</p>
  <p>I've followed the steps of <a href="https://update.angular.io/?l=3&amp;v=8.2-11.0" rel="nofollow noreferrer">https://update.angular.io/?l=3&amp;v=8.2-11.0</a> pretty well.</p>
  <p>There are a few packages in my project that don't seem to be compatible with v.^11, so I installed the packages using</p>
  <pre><code>npm install --legacy-peer-deps
  </code></pre>
  <p>When I try to serve the content with <code>ng serve</code>, I get tons of can't resolve 'util' and can't resolve 'zlib' messages. E.g.,</p>
  <blockquote>
  <p>Error: /Users/mf/node_modules/snapdragon/lib/parser.js Module not found: Error: Can't resolve 'util' in
  '/Users/mf/node_modules/snapdragon/lib'</p>
  <p>Error: /Users/mf/node_modules/sshpk/lib/certificate.js Module not
  found: Error: Can't resolve 'util' in
  '/Users/mf/node_modules/sshpk/lib'</p>
  <p>Error: /Users/mf/node_modules/sshpk/lib/private-key.js Module not
  found: Error: Can't resolve 'util' in
  '/Users/mf/node_modules/sshpk/lib'</p>
  <p>Error: /Users/mf/node_modules/sshpk/lib/errors.js Module not found:
  Error: Can't resolve 'util' in '/Users/mf/node_modules/sshpk/lib'</p>
  <p>Error: /Users/mf/node_modules/sshpk/lib/ed-compat.js Module not found:
  Error: Can't resolve 'util' in '/Users/mf/node_modules/sshpk/lib'</p>
  <p>Error: /Users/mf/node_modules/sshpk/lib/identity.js Module not found:
  Error: Can't resolve 'util' in '/Users/mf/node_modules/sshpk/lib'</p>
  <p>Error: /Users/mf/node_modules/static-extend/index.js Module not found:
  Error: Can't resolve 'util' in '/Users/mf/node_modules/static-extend'</p>
  <p>Error: /Users/mf/node_modules/through2/through2.js Module not found:
  Error: Can't resolve 'util' in '/Users/mf/node_modules/through2'</p>
  <p>Error: /Users/mf/node_modules/tough-cookie/lib/memstore.js Module not
  found: Error: Can't resolve 'util' in
  '/Users/mf/node_modules/tough-cookie/lib'</p>
  <p>Error: /Users/mf/node_modules/tunnel-agent/index.js Module not found:
  Error: Can't resolve 'util' in '/Users/mf/node_modules/tunnel-agent'</p>
  <p>0mError: /Users/mf/node_modules/verror/lib/verror.js Module not found:
  Error: Can't resolve 'util' in '/Users/mf/node_modules/verror/lib'</p>
  <p>Error: /Users/mf/node_modules/@google-cloud/storage/src/file.js Module
  not found: Error: Can't resolve 'zlib' in
  '/Users/mf/node_modules/@google-cloud/storage/src'</p>
  <p>Error: /Users/mf/node_modules/request/request.js Module not found:
  Error: Can't resolve 'zlib' in '/Users/mf/node_modules/request'</p>
  </blockquote>
  <p>These errors look like they span multiple packages????
  I'm not sure how to resolve or whether anybody has seen this before (google suggests not exactly?).</p>
  <p>I could not successfully set up stackBlitz as a demo for this error (I filed a ticket with them, too, about github integration).</p>
  <p>So, best I can do to help you reproduce the issue is provide my package.json:</p>
  <pre><code>{
    &quot;name&quot;: &quot;data-jitsu&quot;,
    &quot;version&quot;: &quot;0.0.0&quot;,
    &quot;license&quot;: &quot;MIT&quot;,
    &quot;scripts&quot;: {
      &quot;ng&quot;: &quot;ng&quot;,
      &quot;start&quot;: &quot;ng serve&quot;,
      &quot;build&quot;: &quot;ng build&quot;,
      &quot;test&quot;: &quot;ng test&quot;,
      &quot;lint&quot;: &quot;ng lint&quot;,
      &quot;e2e&quot;: &quot;cypress open&quot;
    },
    &quot;private&quot;: true,
    &quot;dependencies&quot;: {
      &quot;@angular-devkit/build-angular&quot;: &quot;~0.1102.7&quot;,
      &quot;@angular/animations&quot;: &quot;^11.2.8&quot;,
      &quot;@angular/cdk&quot;: &quot;^11.2.7&quot;,
      &quot;@angular/common&quot;: &quot;^11.2.8&quot;,
      &quot;@angular/compiler&quot;: &quot;^11.2.8&quot;,
      &quot;@angular/compiler-cli&quot;: &quot;^11.2.8&quot;,
      &quot;@angular/core&quot;: &quot;^11.2.8&quot;,
      &quot;@angular/fire&quot;: &quot;^6.1.4&quot;,
      &quot;@angular/forms&quot;: &quot;^11.2.8&quot;,
      &quot;@angular/localize&quot;: &quot;^11.0.0 || ^11.2.0-next&quot;,
      &quot;@angular/material&quot;: &quot;^11.2.7&quot;,
      &quot;@angular/platform-browser&quot;: &quot;^11.2.8&quot;,
      &quot;@angular/platform-browser-dynamic&quot;: &quot;^11.2.8&quot;,
      &quot;@angular/router&quot;: &quot;^11.2.8&quot;,
      &quot;@angular/service-worker&quot;: &quot;^11.0.0 || ^11.2.0-next&quot;,
      &quot;@types/youtube&quot;: &quot;^0.0.42&quot;,
      &quot;ajv&quot;: &quot;^8.0.5&quot;,
      &quot;angular-froala-wysiwyg&quot;: &quot;^3.2.6-1&quot;,
      &quot;autoprefixer&quot;: &quot;^10.0.2&quot;,
      &quot;core-js&quot;: &quot;^3.0.0&quot;,
      &quot;d3&quot;: &quot;^6.6.2&quot;,
      &quot;firebase&quot;: &quot;^8.4.0&quot;,
      &quot;grpc&quot;: &quot;^1.24.6&quot;,
      &quot;hammerjs&quot;: &quot;^2.0.8&quot;,
      &quot;html2canvas&quot;: &quot;^1.0.0-rc.5&quot;,
      &quot;jquery&quot;: &quot;^3.6.0&quot;,
      &quot;karma&quot;: &quot;^5.2.0 || ^6.0.0&quot;,
      &quot;moment&quot;: &quot;^2.29.1&quot;,
      &quot;ng-packagr&quot;: &quot;^11.0.0 || ^11.2.0-next&quot;,
      &quot;ngx-youtube-player&quot;: &quot;9.1.0&quot;,
      &quot;postcss&quot;: &quot;^8.0.9&quot;,
      &quot;protractor&quot;: &quot;^7.0.0&quot;,
      &quot;rxjs&quot;: &quot;^6.6.7&quot;,
      &quot;stripe&quot;: &quot;^8.142.0&quot;,
      &quot;tailwindcss&quot;: &quot;^2.0.0&quot;,
      &quot;tslib&quot;: &quot;^2.2.0&quot;,
      &quot;tslint&quot;: &quot;^6.1.0&quot;,
      &quot;typescript&quot;: &quot;~4.0.0 || ~4.1.0 &gt;=4.0 &lt;4.2&quot;,
      &quot;util&quot;: &quot;^0.11.1&quot;,
      &quot;zone.js&quot;: &quot;~0.11.3&quot;
    },
    &quot;devDependencies&quot;: {
      &quot;@angular-eslint/builder&quot;: &quot;^2.0.0&quot;,
      &quot;@angular-eslint/eslint-plugin&quot;: &quot;^2.0.0&quot;,
      &quot;@angular-eslint/eslint-plugin-template&quot;: &quot;^2.0.0&quot;,
      &quot;@angular-eslint/schematics&quot;: &quot;2.0.2&quot;,
      &quot;@angular-eslint/template-parser&quot;: &quot;^2.0.0&quot;,
      &quot;@angular/cli&quot;: &quot;^11.2.7&quot;,
      &quot;@angular/compiler-cli&quot;: &quot;^8.2.3&quot;,
      &quot;@angular/language-service&quot;: &quot;^11.2.8&quot;,
      &quot;@cypress/webpack-preprocessor&quot;: &quot;^5.7.0&quot;,
      &quot;@types/bootstrap&quot;: &quot;^5.0.12&quot;,
      &quot;@types/d3&quot;: &quot;^6.3.0&quot;,
      &quot;@types/jasmine&quot;: &quot;~3.6.9&quot;,
      &quot;@types/jasminewd2&quot;: &quot;~2.0.3&quot;,
      &quot;@types/node&quot;: &quot;^14.14.37&quot;,
      &quot;@typescript-eslint/eslint-plugin&quot;: &quot;4.16.1&quot;,
      &quot;@typescript-eslint/parser&quot;: &quot;4.16.1&quot;,
      &quot;chance&quot;: &quot;^1.0.16&quot;,
      &quot;cypress&quot;: &quot;^7.0.0&quot;,
      &quot;eslint&quot;: &quot;^7.6.0&quot;,
      &quot;eslint-plugin-import&quot;: &quot;2.22.1&quot;,
      &quot;eslint-plugin-jsdoc&quot;: &quot;30.7.6&quot;,
      &quot;eslint-plugin-prefer-arrow&quot;: &quot;1.2.2&quot;,
      &quot;jasmine-core&quot;: &quot;~3.5.0&quot;,
      &quot;jasmine-spec-reporter&quot;: &quot;~5.0.0&quot;,
      &quot;karma&quot;: &quot;~5.0.0&quot;,
      &quot;karma-chrome-launcher&quot;: &quot;~3.1.0&quot;,
      &quot;karma-cli&quot;: &quot;~2.0.0&quot;,
      &quot;karma-coverage-istanbul-reporter&quot;: &quot;~3.0.2&quot;,
      &quot;karma-jasmine&quot;: &quot;~4.0.0&quot;,
      &quot;karma-jasmine-html-reporter&quot;: &quot;^1.5.0&quot;,
      &quot;protractor&quot;: &quot;~7.0.0&quot;,
      &quot;ts-loader&quot;: &quot;^8.1.0&quot;,
      &quot;ts-node&quot;: &quot;~9.1.1&quot;,
      &quot;typescript&quot;: &quot;~4.1&quot;,
      &quot;webpack&quot;: &quot;~4.18.1&quot;
    }
  }
  </code></pre>
  <p>And link you to the branch on my github repo:
  <a href="https://github.com/Atticus29/dataJitsu/tree/delete-user-version-upgrade" rel="nofollow noreferrer">https://github.com/Atticus29/dataJitsu/tree/delete-user-version-upgrade</a></p>
  <p>So,</p>
  <pre><code>git clone https://github.com/Atticus29/dataJitsu.git
  cd dataJitsu
  git checkout delete-user-version-upgrade
  npm install --legacy-peer-deps
  ng serve
  </code></pre>
  <p>should get you to my error.</p>