title: NPM install permission denied error using root user
body: <p>So I've made a fresh installation of npm/node on my local machine using NVM using root user and everything looks fine, now my issue is when I tried to install using <strong>npm install --unsafe-perm -verbose</strong> command on my project folder error displays in my terminal.</p>
  
  <pre><code>npm verb stack Error: Command failed: /usr/bin/git clone --depth=1 -q -b 0.0.7 https://github.com/Mango/emitter.git /root/.npm/_cacache/tmp/git-clone-28a98ad9
  npm verb stack fatal: could not create leading directories of '/root/.npm/_cacache/tmp/git-clone-28a98ad9': Permission denied
  npm verb stack 
  npm verb stack     at ChildProcess.exithandler (child_process.js:282:12)
  npm verb stack     at ChildProcess.emit (events.js:182:13)
  npm verb stack     at maybeClose (internal/child_process.js:957:16)
  npm verb stack     at Socket.stream.socket.on (internal/child_process.js:378:11)
  npm verb stack     at Socket.emit (events.js:182:13)
  npm verb stack     at Pipe._handle.close [as _onclose] (net.js:598:12)
  npm verb cwd /web/nbltv
  npm verb Linux 4.15.0-29-generic
  npm verb argv "/root/.nvm/versions/node/v10.1.0/bin/node" "/root/.nvm/versions/node/v10.1.0/bin/npm" "install" "--unsafe-per" "-verbose"
  npm verb node v10.1.0
  npm verb npm  v5.6.0
  npm ERR! code 128
  npm ERR! Command failed: /usr/bin/git clone --depth=1 -q -b 0.0.7 https://github.com/Mango/emitter.git /root/.npm/_cacache/tmp/git-clone-28a98ad9
  npm ERR! fatal: could not create leading directories of '/root/.npm/_cacache/tmp/git-clone-28a98ad9': Permission denied
  npm ERR! 
  npm verb exit [ 1, true ]
  
  npm ERR! A complete log of this run can be found in:
  npm ERR!     /root/.npm/_logs/2018-08-20T01_36_33_496Z-debug.log
  </code></pre>
  
  <p><strong>NPM version - 5.6
  NODE version - 10.1</strong></p>
  
  <p>Any help would be much appriciated. Thanks!</p>