title: Cordova Apache wrong module path
body: <h2>My question</h2>
  
  <p>I am learning to make a hybrid application with cordova apache (previously Phonegap?) I am following the steps they recommend our their website:</p>
  
  <pre><code>https://cordova.apache.org/docs/en/latest/guide/cli/index.html
  </code></pre>
  
  <p>I successfully installed nodeJS (if I do the command node --version, it will return its version)</p>
  
  <p>But when I try to install cordova, everything seems working, but not the CLI.</p>
  
  <p>So: I guess the CLI is configured incorrect, but I am not sure. Anyone can help me here?</p>
  
  <hr>
  
  <h2>Notes:</h2>
  
  <ul>
  <li><p>Command used to install cordova (globally):</p>
  
  <pre><code>npm install -g cordova
  </code></pre></li>
  <li><p>Command used to check if it was installed correctly and accessible from the command line (with given errors):</p>
  
  <pre><code>cordova --version
  module.js:340
      throw err;
      ^
  
  Error: Cannot find module 'c:\Program Files\nodejs\node_modules\cordova\bin\cordova'
      at Function.Module._resolveFilename (module.js:338:15)
      at Function.Module._load (module.js:289:25)
      at Function.Module.runMain (module.js:457:10)
      at startup (node.js:138:18)
      at node.js:974:3
  </code></pre></li>
  <li><p>I found out the path in the error doesn't exist:</p>
  
  <pre><code>c:\Program Files\nodejs\node_modules\cordova\bin\cordova
  </code></pre></li>
  <li><p>The correct path have to be:</p>
  
  <pre><code>C:\Users\Username\AppData\Roaming\npm\node_modules\cordova\bin\cordova
  </code></pre></li>
  <li><p>I configured this path in my global system environments:</p>
  
  <pre><code>C:\Users\Username\AppData\Roaming\npm
  </code></pre></li>
  <li><p>I noticed this file (which needs to be called from CLI I guess)</p>
  
  <pre><code>#!/bin/sh
  basedir=`dirname "$0"`
  
  case `uname` in
      *CYGWIN*) basedir=`cygpath -w "$basedir"`;;
  esac
  
  if [ -x "$basedir/node" ]; then
    "$basedir/node"  "$basedir/node_modules/cordova/bin/cordova" "$@"
    ret=$?
  else 
    node  "$basedir/node_modules/cordova/bin/cordova" "$@"
    ret=$?
  fi
  exit $ret
  </code></pre></li>
  <li><p>I am working on Windows 8</p></li>
  </ul>