title: Global NPM install failing on OSX
body: <p>Having a bit of trouble with an NPM install of a project I'm working on. </p>
  
  <p>The npm install works find when run inside a VM against package.json. However, when run from the host OSX machine (not shared folder or any conflicts like that) the install goes into a error loop.</p>
  
  <p>Package.json:</p>
  
  <pre><code>{
    "name": "crowdtutor",
    "version": "0.0.0",
    "dependencies": {},
    "devDependencies": {
      "grunt": "~0.4.1",
      "grunt-autoprefixer": "~0.4.0",
      "grunt-bower-install": "~0.7.0",
      "grunt-concurrent": "~0.4.1",
      "grunt-contrib-clean": "~0.5.0",
      "grunt-contrib-coffee": "~0.7.0",
      "grunt-contrib-compass": "~0.6.0",
      "grunt-contrib-concat": "~0.3.0",
      "grunt-contrib-connect": "~0.5.0",
      "grunt-contrib-copy": "~0.4.1",
      "grunt-contrib-cssmin": "~0.7.0",
      "grunt-contrib-htmlmin": "~0.1.3",
      "grunt-contrib-imagemin": "~0.3.0",
      "grunt-contrib-jshint": "~0.7.1",
      "grunt-contrib-watch": "~0.5.2",
      "grunt-google-cdn": "~0.2.0",
      "grunt-karma": "^0.8.2",
      "grunt-newer": "~0.5.4",
      "grunt-ngmin": "~0.0.2",
      "grunt-rev": "~0.1.0",
      "grunt-svgmin": "~0.2.0",
      "grunt-usemin": "~2.0.0",
      "jshint-stylish": "~0.1.3",
      "karma": "^0.12.1",
      "karma-chrome-launcher": "^0.1.2",
      "karma-jasmine": "^0.1.5",
      "karma-ng-html2js-preprocessor": "^0.1.0",
      "karma-ng-scenario": "^0.1.0",
      "karma-phantomjs-launcher": "^0.1.2",
      "load-grunt-tasks": "~0.2.0",
      "time-grunt": "~0.2.1",
      "compass": "^0.1.0",
      "grunt-cli": "^0.1.13",
      "mongo-hacker": "0.0.3"
    },
    "engines": {
      "node": "&gt;=0.8.0"
    },
    "scripts": {
      "test": "grunt test"
    }
  }
  </code></pre>
  
  <p>.npmrc:</p>
  
  <pre><code>registry = http://registry.npmjs.org/
  dev = true
  #fetch-retries = 120
  strict-ssl = false
  #tmp = /Users/matt/.npmtmp
  </code></pre>
  
  <p>And (part of endlessly looping) output of <code>npm install -g</code>:</p>
  
  <pre><code>npm ERR! System Darwin 13.1.0
  npm ERR! command "node" "/usr/local/bin/npm" "install" "-g"
  npm ERR! cwd /Users/matt/dev/crowdtutor/opa
  npm ERR! node -v v0.10.28
  npm ERR! npm -v 1.4.10
  npm ERR! path /usr/local/lib/node_modules/crowdtutor/node_modules/karma-ng-scenario/node_modules/karma/node_modules/karma-coverage/node_modules/karma/node_modules/grunt-jscs-checker/node_modules/time-grunt/node_modules/text-table/node_modules/tap/test/deep.js
  npm ERR! fstream_path /usr/local/lib/node_modules/crowdtutor/node_modules/karma-ng-scenario/node_modules/karma/node_modules/karma-coverage/node_modules/karma/node_modules/grunt-jscs-checker/node_modules/time-grunt/node_modules/text-table/node_modules/tap/test/deep.js
  npm ERR! fstream_type File
  npm ERR! fstream_class FileWriter
  npm ERR! code ENOENT
  npm ERR! errno 34
  npm ERR! fstream_stack /usr/local/lib/node_modules/npm/node_modules/fstream/lib/writer.js:284:26
  npm ERR! fstream_stack Object.oncomplete (fs.js:107:15)
  npm ERR! Error: ENOENT, lstat '/usr/local/lib/node_modules/crowdtutor/node_modules/karma-ng-html2js-preprocessor/node_modules/grunt-bump/node_modules/grunt-contrib-nodeunit/node_modules/hooker/node_modules/grunt/lib/grunt.js'
  npm ERR! If you need help, you may report this *entire* log,
  npm ERR! including the npm and node versions, at:
  npm ERR!     &lt;http://github.com/npm/npm/issues&gt;
  
  npm ERR! System Darwin 13.1.0
  npm ERR! command "node" "/usr/local/bin/npm" "install" "-g"
  npm ERR! cwd /Users/matt/dev/crowdtutor/opa
  npm ERR! node -v v0.10.28
  npm ERR! npm -v 1.4.10
  npm ERR! path /usr/local/lib/node_modules/crowdtutor/node_modules/karma-ng-html2js-preprocessor/node_modules/grunt-bump/node_modules/grunt-contrib-nodeunit/node_modules/hooker/node_modules/grunt/lib/grunt.js
  npm ERR! fstream_path /usr/local/lib/node_modules/crowdtutor/node_modules/karma-ng-html2js-preprocessor/node_modules/grunt-bump/node_modules/grunt-contrib-nodeunit/node_modules/hooker/node_modules/grunt/lib/grunt.js
  npm ERR! fstream_type File
  npm ERR! fstream_class FileWriter
  npm ERR! code ENOENT
  npm ERR! errno 34
  npm ERR! fstream_stack /usr/local/lib/node_modules/npm/node_modules/fstream/lib/writer.js:284:26
  npm ERR! fstream_stack Object.oncomplete (fs.js:107:15)
  npm ERR! error rolling back Error: ENOTEMPTY, rmdir '/usr/local/lib/node_modules/crowdtutor/node_modules/karma-ng-scenario/node_modules/karma/node_modules/karma-coverage/node_modules/karma/node_modules/grunt-jscs-checker/node_modules/vow/node_modules/jspath/node_modules/nodeunit'
  npm ERR! error rolling back  grunt-jscs-checker@0.4.4 { [Error: ENOTEMPTY, rmdir '/usr/local/lib/node_modules/crowdtutor/node_modules/karma-ng-scenario/node_modules/karma/node_modules/karma-coverage/node_modules/karma/node_modules/grunt-jscs-checker/node_modules/vow/node_modules/jspath/node_modules/nodeunit']
  npm ERR! error rolling back   errno: 53,
  npm ERR! error rolling back   code: 'ENOTEMPTY',
  npm ERR! error rolling back   path: '/usr/local/lib/node_modules/crowdtutor/node_modules/karma-ng-scenario/node_modules/karma/node_modules/karma-coverage/node_modules/karma/node_modules/grunt-jscs-checker/node_modules/vow/node_modules/jspath/node_modules/nodeunit' }
  npm http 200 http://registry.npmjs.org/serve-index
  npm http 200 http://registry.npmjs.org/multiparty
  npm http 304 http://registry.npmjs.org/hashish
  npm http 304 http://registry.npmjs.org/findit
  npm http 304 http://registry.npmjs.org/superagent
  npm ERR! Error: ENOENT, lstat '/usr/local/lib/node_modules/crowdtutor/node_modules/karma-ng-scenario/node_modules/karma/node_modules/karma-coverage/node_modules/karma/node_modules/grunt-jscs-checker/node_modules/vow/node_modules/jspath/node_modules/cliff/test/cliff-test.js'
  npm ERR! If you need help, you may report this *entire* log,
  npm ERR! including the npm and node versions, at:
  npm ERR!     &lt;http://github.com/npm/npm/issues&gt;
  
  npm ERR! System Darwin 13.1.0
  npm ERR! command "node" "/usr/local/bin/npm" "install" "-g"
  npm ERR! cwd /Users/matt/dev/crowdtutor/opa
  npm ERR! node -v v0.10.28
  npm ERR! npm -v 1.4.10
  npm ERR! path /usr/local/lib/node_modules/crowdtutor/node_modules/karma-ng-scenario/node_modules/karma/node_modules/karma-coverage/node_modules/karma/node_modules/grunt-jscs-checker/node_modules/vow/node_modules/jspath/node_modules/cliff/test/cliff-test.js
  npm ERR! fstream_path /usr/local/lib/node_modules/crowdtutor/node_modules/karma-ng-scenario/node_modules/karma/node_modules/karma-coverage/node_modules/karma/node_modules/grunt-jscs-checker/node_modules/vow/node_modules/jspath/node_modules/cliff/test/cliff-test.js
  npm ERR! fstream_type File
  npm ERR! fstream_class FileWriter
  npm ERR! code ENOENT
  npm ERR! errno 34
  npm ERR! fstream_stack /usr/local/lib/node_modules/npm/node_modules/fstream/lib/writer.js:284:26
  npm ERR! fstream_stack Object.oncomplete (fs.js:107:15)
  npm ERR! Error: ENOENT, utime '/usr/local/lib/node_modules/crowdtutor/node_modules/karma-ng-html2js-preprocessor/node_modules/grunt-bump/node_modules/grunt-contrib-nodeunit/node_modules/tap/node_modules/glob/node_modules/rimraf/fiber.js'
  npm ERR! If you need help, you may report this *entire* log,
  npm ERR! including the npm and node versions, at:
  npm ERR!     &lt;http://github.com/npm/npm/issues&gt;
  
  npm ERR! System Darwin 13.1.0
  npm ERR! command "node" "/usr/local/bin/npm" "install" "-g"
  npm ERR! cwd /Users/matt/dev/crowdtutor/opa
  npm ERR! node -v v0.10.28
  npm ERR! npm -v 1.4.10
  npm ERR! path /usr/local/lib/node_modules/crowdtutor/node_modules/karma-ng-html2js-preprocessor/node_modules/grunt-bump/node_modules/grunt-contrib-nodeunit/node_modules/tap/node_modules/glob/node_modules/rimraf/fiber.js
  npm ERR! fstream_path /usr/local/lib/node_modules/crowdtutor/node_modules/karma-ng-html2js-preprocessor/node_modules/grunt-bump/node_modules/grunt-contrib-nodeunit/node_modules/tap/node_modules/glob/node_modules/rimraf/fiber.js
  npm ERR! fstream_type File
  npm ERR! fstream_class FileWriter
  npm ERR! fstream_finish_call utimes
  npm ERR! code ENOENT
  npm ERR! errno 34
  npm ERR! fstream_stack /usr/local/lib/node_modules/npm/node_modules/fstream/lib/writer.js:305:19
  npm ERR! fstream_stack Object.oncomplete (fs.js:107:15)
  npm http GET http://registry.npmjs.org/emitter-component
  npm http GET http://registry.npmjs.org/cookiejar
  npm http GET http://registry.npmjs.org/methods
  npm http GET http://registry.npmjs.org/reduce-component
  npm http GET http://registry.npmjs.org/better-assert
  npm ERR! Error: ENOENT, lstat '/usr/local/lib/node_modules/crowdtutor/node_modules/karma-ng-scenario/node_modules/karma/node_modules/chai/node_modules/mocha-phantomjs/node_modules/requirejs/bin/r.js'
  npm ERR! If you need help, you may report this *entire* log,
  npm ERR! including the npm and node versions, at:
  npm ERR!     &lt;http://github.com/npm/npm/issues&gt;
  
  npm ERR! System Darwin 13.1.0
  npm ERR! command "node" "/usr/local/bin/npm" "install" "-g"
  npm ERR! cwd /Users/matt/dev/crowdtutor/opa
  npm ERR! node -v v0.10.28
  npm ERR! npm -v 1.4.10
  npm ERR! path /usr/local/lib/node_modules/crowdtutor/node_modules/karma-ng-scenario/node_modules/karma/node_modules/chai/node_modules/mocha-phantomjs/node_modules/requirejs/bin/r.js
  npm ERR! fstream_path /usr/local/lib/node_modules/crowdtutor/node_modules/karma-ng-scenario/node_modules/karma/node_modules/chai/node_modules/mocha-phantomjs/node_modules/requirejs/bin/r.js
  npm ERR! fstream_type File
  npm ERR! fstream_class FileWriter
  npm ERR! code ENOENT
  npm ERR! errno 34
  npm ERR! fstream_stack /usr/local/lib/node_modules/npm/node_modules/fstream/lib/writer.js:284:26
  npm ERR! fstream_stack Object.oncomplete (fs.js:107:15)
  npm ERR! error rolling back Error: ENOTEMPTY, rmdir '/usr/local/lib/node_modules/crowdtutor/node_modules/grunt-newer/node_modules/grunt-cli/node_modules/findup-sync/node_modules/grunt/node_modules/glob/node_modules/tap/node_modules/glob/node_modules/minimatch/node_modules/sigmund/node_modules/tap'
  npm ERR! error rolling back  glob@3.1.21 { [Error: ENOTEMPTY, rmdir '/usr/local/lib/node_modules/crowdtutor/node_modules/grunt-newer/node_modules/grunt-cli/node_modules/findup-sync/node_modules/grunt/node_modules/glob/node_modules/tap/node_modules/glob/node_modules/minimatch/node_modules/sigmund/node_modules/tap']
  npm ERR! error rolling back   errno: 53,
  npm ERR! error rolling back   code: 'ENOTEMPTY',
  npm ERR! error rolling back   path: '/usr/local/lib/node_modules/crowdtutor/node_modules/grunt-newer/node_modules/grunt-cli/node_modules/findup-sync/node_modules/grunt/node_modules/glob/node_modules/tap/node_modules/glob/node_modules/minimatch/node_modules/sigmund/node_modules/tap' }
  npm http 304 http://registry.npmjs.org/express
  npm http 304 http://registry.npmjs.org/utest
  npm http 304 http://registry.npmjs.org/underscore
  npm http 304 http://registry.npmjs.org/gently
  npm http 200 http://registry.npmjs.org/d-utils
  npm ERR! Error: ENOENT, utime '/usr/local/lib/node_modules/crowdtutor/node_modules/grunt-bower-install/node_modules/grunt-contrib-jshint/node_modules/jshint/node_modules/cli/node_modules/glob/node_modules/rimraf/fiber.js'
  npm ERR! If you need help, you may report this *entire* log,
  npm ERR! including the npm and node versions, at:
  npm ERR!     &lt;http://github.com/npm/npm/issues&gt;
  
  npm ERR! System Darwin 13.1.0
  npm ERR! command "node" "/usr/local/bin/npm" "install" "-g"
  npm ERR! cwd /Users/matt/dev/crowdtutor/opa
  npm ERR! node -v v0.10.28
  npm ERR! npm -v 1.4.10
  npm ERR! path /usr/local/lib/node_modules/crowdtutor/node_modules/grunt-bower-install/node_modules/grunt-contrib-jshint/node_modules/jshint/node_modules/cli/node_modules/glob/node_modules/rimraf/fiber.js
  npm ERR! fstream_path /usr/local/lib/node_modules/crowdtutor/node_modules/grunt-bower-install/node_modules/grunt-contrib-jshint/node_modules/jshint/node_modules/cli/node_modules/glob/node_modules/rimraf/fiber.js
  npm ERR! fstream_type File
  npm ERR! fstream_class FileWriter
  npm ERR! fstream_finish_call utimes
  npm ERR! code ENOENT
  npm ERR! errno 34
  npm ERR! fstream_stack /usr/local/lib/node_modules/npm/node_modules/fstream/lib/writer.js:305:19
  npm ERR! fstream_stack Object.oncomplete (fs.js:107:15)
  npm http GET http://registry.npmjs.org/qs
  npm http 304 http://registry.npmjs.org/wordwrap
  npm http 304 http://registry.npmjs.org/color-parser
  npm http 200 http://registry.npmjs.org/oop/-/oop-0.0.3.tgz
  npm http 304 http://registry.npmjs.org/css
  npm http 304 http://registry.npmjs.org/mime
  npm http GET http://registry.npmjs.org/temp
  npm http GET http://registry.npmjs.org/fstream
  npm http GET http://registry.npmjs.org/binary
  npm http 304 http://registry.npmjs.org/body-parser
  npm http 304 http://registry.npmjs.org/rework-visit
  npm http 304 http://registry.npmjs.org/bytes
  npm http 304 http://registry.npmjs.org/rework-inherit
  npm http 304 http://registry.npmjs.org/express-session
  </code></pre>
  
  <p>My NODE_PATH is set to </p>
  
  <pre><code>/usr/local/bin/node
  </code></pre>
  
  <p>Node was installed via brew and i'm on Mavericks OSX.</p>
  
  <p>I have run <code>npm cache clean</code> and am confident it isn't a permissions issue anywhere. To my eyes, there seems to be some cyclic :node_modules: directory building there? Help!</p>