title: Updating angular version from 10 to 12 shows : An unhandled exception occurred: Must use import to load ES Module
body: <p>While updating the angular from 10 to 12, I was following all the steps which are already written here</p>
  <p><a href="https://update.angular.io/?l=3&amp;v=10.0-12.0" rel="nofollow noreferrer">https://update.angular.io/?l=3&amp;v=10.0-12.0</a></p>
  <p>However after doing all these steps properly, here are the errors I am getting:</p>
  <pre><code>An unhandled exception occurred: Must use import to load ES Module: 
  
  /home/../angular/node_modules/@angular/compiler-cli/bundles/index.js
  require() of ES modules is not supported.
  require() of /home/../angular/node_modules/@angular/compiler-cli/bundles/index.js from /home/../angular/node_modules/@angular-devkit/build-angular/src/webpack/configs/common.js is an ES module file as it is a .js file whose nearest parent package.json contains &quot;type&quot;: &quot;module&quot; which defines all .js files in that package scope as ES modules.
  Instead rename index.js to end in .cjs, change the requiring code to use import(), or remove &quot;type&quot;: &quot;module&quot; from /home/../angular/node_modules/@angular/compiler-cli/package.json.
  </code></pre>
  <p>I could not understand how to fix it. I tried to remove <code>&quot;type&quot;: &quot;module&quot;</code> from <code>/home/../angular/node_modules/@angular/compiler-cli/package.json</code> but it did not solve my problem.</p>
  <p>I will so glad if someone helps me solve this issue</p>