title: npm ERR! Cannot find module 'encoding'
body: <p>I encounter this problem when am trying to install ganache-cli in my laptop (Kali Linux). The error that I came across is:</p>
  
  <pre><code>sudo npm install -g ganache-cli
  npm ERR! code MODULE_NOT_FOUND
  npm ERR! Cannot find module 'encoding'
  </code></pre>
  
  <p>The debug log:</p>
  
  <pre><code>0 info it worked if it ends with ok
  1 verbose cli [ '/usr/bin/node', '/usr/bin/npm', 'install', '-g', 'ganache-cli' ]
  2 info using npm@5.8.0
  3 info using node@v8.11.2
  4 verbose npm-session 8012bd73873770d8
  5 silly install loadCurrentTree
  6 silly install readGlobalPackageData
  7 silly fetchPackageMetaData error for ganache-cli@latest Cannot find module 'encoding'
  8 verbose stack Error: Cannot find module 'encoding'
  8 verbose stack     at Function.Module._resolveFilename (module.js:547:15)
  8 verbose stack     at Function.Module._load (module.js:474:25)
  8 verbose stack     at Module.require (module.js:596:17)
  8 verbose stack     at require (internal/module.js:11:18)
  8 verbose stack     at Object.&lt;anonymous&gt; (/usr/share/npm/node_modules/pacote/node_modules/make-fetch-happen/node_modules/node-fetch-npm/src/body.js:13:17)
  8 verbose stack     at Module._compile (module.js:652:30)
  8 verbose stack     at Object.Module._extensions..js (module.js:663:10)
  8 verbose stack     at Module.load (module.js:565:32)
  8 verbose stack     at tryModuleLoad (module.js:505:12)
  8 verbose stack     at Function.Module._load (module.js:497:3)
  8 verbose stack     at Module.require (module.js:596:17)
  8 verbose stack     at require (internal/module.js:11:18)
  8 verbose stack     at Object.&lt;anonymous&gt; (/usr/share/npm/node_modules/pacote/node_modules/make-fetch-happen/node_modules/node-fetch-npm/src/index.js:15:14)
  8 verbose stack     at Module._compile (module.js:652:30)
  8 verbose stack     at Object.Module._extensions..js (module.js:663:10)
  8 verbose stack     at Module.load (module.js:565:32)
  9 verbose cwd /home/shirke
  10 verbose Linux 4.15.0-kali2-amd64
  11 verbose argv "/usr/bin/node" "/usr/bin/npm" "install" "-g" "ganache-cli"
  12 verbose node v8.11.2
  13 verbose npm  v5.8.0
  14 error code MODULE_NOT_FOUND
  15 error Cannot find module 'encoding'
  16 verbose exit [ 1, true ]
  </code></pre>
  
  <p>This error is bugging me a lot as am not able to do any work.</p>