title: Why npm install fails in ArmV7 docker image when installing package globally?
body: <p>Here is my Dockerfile:</p>
  
  <pre><code>FROM arm32v7/node:8
  RUN npm --version
  RUN npm install -g yarn
  </code></pre>
  
  <p>And here is output log:</p>
  
  <pre><code>Sending build context to Docker daemon  65.25MB
  Step 1/5 : FROM arm32v7/node:8
   ---&gt; 1e66bc1fab80
  Step 2/5 : RUN npm --version
   ---&gt; Running in c62ffb8ecc56
  Unknown host QEMU_IFLA type: 40
  Unknown host QEMU_IFLA type: 41
  Unknown host QEMU_IFLA type: 40
  Unknown host QEMU_IFLA type: 41
  Unknown QEMU_IFLA_INFO_KIND ipip
  Unknown host QEMU_IFLA type: 40
  Unknown host QEMU_IFLA type: 41
  Unknown QEMU_IFLA_INFO_KIND ip6tnl
  Unknown host QEMU_IFLA type: 40
  Unknown host QEMU_IFLA type: 41
  6.4.1
  Removing intermediate container c62ffb8ecc56
   ---&gt; 69f0396a3742
  Step 3/5 : RUN npm install -g yarn
   ---&gt; Running in d173b95e284c
  Unknown host QEMU_IFLA type: 40
  Unknown host QEMU_IFLA type: 41
  Unknown host QEMU_IFLA type: 40
  Unknown host QEMU_IFLA type: 41
  Unknown QEMU_IFLA_INFO_KIND ipip
  Unknown host QEMU_IFLA type: 40
  Unknown host QEMU_IFLA type: 41
  Unknown QEMU_IFLA_INFO_KIND ip6tnl
  Unknown host QEMU_IFLA type: 40
  Unknown host QEMU_IFLA type: 41
  Error: could not get uid/gid
  [ 'nobody', 0 ]
  
      at /usr/local/lib/node_modules/npm/node_modules/uid-number/uid-number.js:37:16
      at ChildProcess.exithandler (child_process.js:283:5)
      at emitTwo (events.js:126:13)
      at ChildProcess.emit (events.js:214:7)
      at maybeClose (internal/child_process.js:915:16)
      at Process.ChildProcess._handle.onexit (internal/child_process.js:209:5)
  TypeError: Cannot read property 'get' of undefined
      at errorHandler (/usr/local/lib/node_modules/npm/lib/utils/error-handler.js:205:18)
      at /usr/local/lib/node_modules/npm/bin/npm-cli.js:78:20
      at cb (/usr/local/lib/node_modules/npm/lib/npm.js:228:22)
      at /usr/local/lib/node_modules/npm/lib/npm.js:266:24
      at /usr/local/lib/node_modules/npm/lib/config/core.js:83:7
      at Array.forEach (&lt;anonymous&gt;)
      at /usr/local/lib/node_modules/npm/lib/config/core.js:82:13
      at f (/usr/local/lib/node_modules/npm/node_modules/once/once.js:25:25)
      at afterExtras (/usr/local/lib/node_modules/npm/lib/config/core.js:173:20)
      at Conf.&lt;anonymous&gt; (/usr/local/lib/node_modules/npm/lib/config/core.js:231:22)
  /usr/local/lib/node_modules/npm/lib/utils/error-handler.js:205
    if (npm.config.get('json')) {
                   ^
  
  TypeError: Cannot read property 'get' of undefined
      at process.errorHandler (/usr/local/lib/node_modules/npm/lib/utils/error-handler.js:205:18)
      at emitOne (events.js:116:13)
      at process.emit (events.js:211:7)
      at process._fatalException (bootstrap_node.js:391:26)
  The command '/bin/sh -c npm install -g yarn' returned a non-zero code: 7
  </code></pre>
  
  <p>Any ideas why it's failing? I building image with with commad <code>docker build . -t myimage</code> (I am running docker on Mac OS X).</p>
  
  <hr>
  
  <p>Please not that it works when installing yarn without "-g" flag.</p>