title: Npm install failed with "cannot run in wd"
body: <p>I am trying to get my node environment set up on a new Ubuntu 12.04 instance, with Node 0.8.14 already installed, but I ran into problems when I try to run <code>npm install</code>.
  So when I try <code>npm install</code>, it says that I need to run it as root or adminisrator:</p>
  
  <pre><code>Error: EACCES, mkdir '/usr/local/lib/node_modules/coffee-script'
  npm ERR!  { [Error: EACCES, mkdir '/usr/local/lib/node_modules/coffee-script']
  npm ERR!   errno: 3,
  npm ERR!   code: 'EACCES',
  npm ERR!   path: '/usr/local/lib/node_modules/coffee-script',
  npm ERR!   fstream_type: 'Directory',
  npm ERR!   fstream_path: '/usr/local/lib/node_modules/coffee-script',
  npm ERR!   fstream_class: 'DirWriter',
  npm ERR!   fstream_stack: 
  npm ERR!    [ 'DirWriter._create                 (/usr/local/lib/node_modules/npm/node_modules/fstream/lib/dir-writer.js:36:23)',
  npm ERR!      '/usr/local/lib/node_modules/npm/node_modules/mkdirp/index.js:37:53',
  npm ERR!      'Object.oncomplete (fs.js:297:15)' ] }
  npm ERR! 
  npm ERR! Please try running this command again as root/Administrator.
  </code></pre>
  
  <p>But when try to run it as sudo, it says the following:</p>
  
  <pre><code>npm WARN cannot run in wd PackNodeDev@0.0.1-166 npm install -g coffee-script node-gyp (wd=/home/ubuntu/PackNode)
  </code></pre>
  
  <p>In my package.json, it contains the following scripts:</p>
  
  <pre><code>"scripts": {
      "preinstall": "npm install -g coffee-script node-gyp",
      "start": "node server.js",
      "test": "mocha --require should --compilers coffee:coffee-script --colors"
   },
  </code></pre>
  
  <p>The rest of devdependencies are valid since I have been installing it all right on my own machine (Mac)
  Does anyone have a clue why this is happening?</p>