title: What exactly does 'npm install -g ' do?
body: <p>I want to set up a private npm registry using sinopia and I executed <code>npm install -g sinopia</code>, but some error message occurred:</p>
  
  <pre><code>&gt; crypt3@0.1.8 install /usr/local/lib/node_modules/sinopia/node_modules/crypt3
  &gt; node-gyp rebuild
  
  gyp WARN EACCES user "root" does not have permission to access the dev dir "/root/.node-gyp/4.2.3"
  gyp WARN EACCES attempting to reinstall using temporary dev dir "/usr/local/lib/node_modules/sinopia/node_modules/crypt3/.node-gyp"
  make: Entering directory `/usr/local/lib/node_modules/sinopia/node_modules/crypt3/build'
    CXX(target) Release/obj.target/crypt3/crypt3.o
  In file included from ../crypt3.cc:7:0:
  ../node_modules/nan/nan.h:261:25: error: redefinition of âtemplate&lt;class T&gt; v8::Local&lt;T&gt; _NanEnsureLocal(v8::Local&lt;T&gt;)â
   NAN_INLINE v8::Local&lt;T&gt; _NanEnsureLocal(v8::Local&lt;T&gt; val) {
                           ^
  ../node_modules/nan/nan.h:256:25: error: âtemplate&lt;class T&gt; v8::Local&lt;T&gt; _NanEnsureLocal(v8::Handle&lt;T&gt;)â previously declared here
   NAN_INLINE v8::Local&lt;T&gt; _NanEnsureLocal(v8::Handle&lt;T&gt; val) {
                           ^
  ../node_modules/nan/nan.h:661:13: error: ânode::smallocâ has not been declared
       , node::smalloc::FreeCallback callback
               ^
  </code></pre>
  
  <p>I can see the <code>.h</code> files which relate to C or C++; how come this happens? All the stuff <a href="https://github.com/rlidwka/sinopia" rel="noreferrer">I found</a> within sinopia is about JavaScript.</p>
  
  <p>What does <code>npm install</code> do? In my opinion, it should only initiate some download process.</p>