title: Not able to run any npm command due to following error - Error: Cannot find module 'semver'
body: <ul>
  <li><p>previously node was working properly.</p></li>
  <li><p>After that as i wanted to install express &amp; socket.io.</p></li>
  <li><p>it asked for node version update.</p></li>
  <li><p>i tried to update node version &amp; i believe i forgot some command to run in updation process.</p></li>
  <li><p>now it's giving following error on any npm command. even if i type only npm, that'll give error.</p>
  
  <pre><code>m@m-Lenovo-ideapad-320-15IKB:/var/www/html/chat$ npm -v
  nternal/modules/cjs/loader.js:638
      throw err;
      ^
  
  Error: Cannot find module 'semver'
      at Function.Module._resolveFilename (internal/modules/cjs/loader.js:636:15)
      at Function.Module._load (internal/modules/cjs/loader.js:562:25)
      at Module.require (internal/modules/cjs/loader.js:692:17)
      at require (internal/modules/cjs/helpers.js:25:18)
      at Object.&lt;anonymous&gt; (/usr/share/npm/lib/utils/unsupported.js:2:14)
      at Module._compile (internal/modules/cjs/loader.js:778:30)
      at Object.Module._extensions..js (internal/modules/cjs/loader.js:789:10)
      at Module.load (internal/modules/cjs/loader.js:653:32)
      at tryModuleLoad (internal/modules/cjs/loader.js:593:12)
      at Function.Module._load (internal/modules/cjs/loader.js:585:3)
  </code></pre></li>
  </ul>