title: How to uninstall npm package?
body: <p>I've installed <code>grunt</code> using <code>sudo npm install grunt</code> and now I can't remove it.</p>
  
  <p>I've tried:</p>
  
  <pre><code>$ sudo npm uninstall grunt
  </code></pre>
  
  <p>But it gives me a <code>WARN</code>:</p>
  
  <blockquote>
  <pre><code>npm WARN uninstall not installed in /home/kuba/projects/node_modules: "grunt-cli"
  </code></pre>
  </blockquote>
  
  <p>I've also tried <code>rm</code>, <code>remove</code> and <code>unlink</code>. and <code>-g</code> options, but those give:</p>
  
  <blockquote>
  <pre><code>npm WARN uninstall not installed in /usr/lib/node_modules: "grunt"
  </code></pre>
  </blockquote>
  
  <p>But I still can run <code>grunt</code> from command line.</p>
  
  <p><strong>EDIT</strong>:</p>
  
  <pre><code>$ whereis grunt
  grunt: /usr/local/bin/grunt
  $ file /usr/local/bin/grunt
  /usr/local/bin/grunt: symbolic link to `../lib/node_modules/grunt/bin/grunt'
  $ ls /usr/local/lib/node_modules
  grunt jshint
  $ ls /usr/lib/node_modules
  bower  csslint  devtools-terminal  npm  plato
  </code></pre>
  
  <p>Why I have 2 directories with <code>npm</code>? Is it safe to just delete them?</p>
  
  <p><strong>EDITOR NOTE</strong>:</p>
  
  <p><em>This question was asked over 5 years ago as <strong>How to uninstall npm package</strong>. It's been a very useful question favourited by many, who found a solution to their problem, so I'm changing it back from a recent edit that called it <strong>How to uninstall grunt package</strong>, because it requires the same procedure as any other <code>npm</code> package.</em></p>