title: npm root: No such file or directory
body: <p>What does <code>npm root</code> return? </p>
  
  <p>I know here is how <code>npm</code> finds the <code>node_modules</code> directory:</p>
  
  <blockquote>
    <p>Look for the module in the ./node_modules directory. If it is not there, recursively search in the parent directories’ ./node_modules until either the module is found or the root of the file system is reached.</p>
  </blockquote>
  
  <p>Will <code>npm root</code> returns the same thing? </p>
  
  <p>I have a <code>node_modules</code> directory up in a higher place, say <code>/path/to/mynpmroot</code>, but when doing <code>npm root</code> at a much lower place, say <code>/path/to/mynpmroot/then/very/deep/here</code>, the <code>npm root</code> gives me the path of <code>/path/to/mynpmroot/then/very/deep/node_modules</code>. </p>
  
  <p>Is it normal? Because when I do <code>ls /path/to/mynpmroot/then/very/deep/node_modules</code>, I'll get:</p>
  
  <pre><code>ls: /path/to/mynpmroot/then/very/deep/node_modules: No such file or directory
  </code></pre>
  
  <p>This is annoying to me. but do I need to care? 
  (as running node scripts within <code>/path/to/mynpmroot/then/very/deep/here</code> are just fine). </p>
  
  <p>How could it happen, and how can I fix it? </p>