title: Angular | Chunk asset optimisation
body: <p>This question is a duplicate of <a href="https://stackoverflow.com/questions/49184787/92-chunk-asset-optimization-webpack">92% chunk asset optimization - webpack
  </a>. But there was no satisfactory answer for this.</p>
  
  <p>Actually, at local, I use <code>ng serve</code> or <code>nmp start</code> to start my service and it works fine. But at EC2 instance I need to compress my webpack, so I use <code>ng build --aot --prod</code>.</p>
  
  <p>A week ago, everything was working fine but suddenly it started stuck at this line: <code>92% chunk asset optimization</code>, I don't know what is going wrong.</p>
  
  <p>That is below:</p>
  
  <blockquote>
  <pre><code>Your global Angular CLI version (6.0.3) is greater than your local
  version (1.6.1). The local Angular CLI version is used.
  
  To disable this warning use "ng config -g cli.warnings.versionMismatch false".
   11% building modules 10/14 modules 4 active ...src/assets/css/smartadmin-rtl.min.cssNode#moveTo was deprecated. Use Container#append.
   92% chunk asset optimization
  </code></pre>
  </blockquote>
  
  <p>The possible reason can be that I have developed and tested everything on npm-<code>6.0.0</code> and I'm trying to deploy on npm-<code>5.6.0</code>.</p>
  
  <p>But When I try to update it using <code>npm i -g npm to update</code> it shows:</p>
  
  <blockquote>
  <pre><code>/home/ubuntu/.npm-global/bin/npm -&gt; /home/ubuntu/.npm-global/lib/node_modules/npm/bin/npm-cli.js
  /home/ubuntu/.npm-global/bin/npx -&gt; /home/ubuntu/.npm-global/lib/node_modules/npm/bin/npx-cli.js
  /home/ubuntu/.npm-global/bin/update -&gt; /home/ubuntu/.npm-global/lib/node_modules/update/bin/update.js
  + to@0.2.9
  + update@0.7.4
  + npm@6.1.0
  updated 3 packages in 15.729s
  </code></pre>
  </blockquote>
  
  <p>and when I try to run <code>sudo npm i -g npm to update</code> it shows this:</p>
  
  <blockquote>
  <pre><code>npm ERR! code 1
  npm ERR! Command failed: /usr/bin/git clone -g git://github.com/jonschlinkert/resolve-file.got /home/ubuntu/.npm/_cacache/tmp/git-clone-d9e6c8aa
  npm ERR! /home/ubuntu/.npm/_cacache/tmp/git-clone-d9e6c8aa/.git: Permission denied
  npm ERR! 
  
  npm ERR! A complete log of this run can be found in:
  npm ERR!     /home/ubuntu/.npm/_logs/2018-05-24T14_22_49_199Z-debug.log
  </code></pre>
  </blockquote>
  
  <p>I tried searching these error but no help.</p>
  
  <p>Or the other issue can be:</p>
  
  <p>Now my service has started using <code>WebSocket in Angular</code>, which was not there a week ago.</p>
  
  <p>Please help me resolve this. </p>