title: Adding Platform in Apache Cordova does not work
body: <p>I am installing Apache Cordova on Ubuntu 13.10, following these instructions:
  <a href="http://cordova.apache.org/docs/en/3.5.0//guide_cli_index.md.html#The%20Command-Line%20Interface" rel="nofollow">http://cordova.apache.org/docs/en/3.5.0//guide_cli_index.md.html#The%20Command-Line%20Interface</a></p>
  
  <p>I got stuck on the section "Add Platforms":</p>
  
  <pre><code>$ cordova platforms ls
  
  Installed platforms: 
  Available platforms: amazon-fireos, android, blackberry10, firefoxos, ubuntu
  </code></pre>
  
  <p>looks like Ubuntu is available. So I proceed.</p>
  
  <pre><code>$ cordova platform add ubuntu
  Checking ubuntu requirements...
  Running "dpkg-query -Wf'${db:Status-abbrev}' cmake debhelper libx11-dev libicu-dev pkg-config qtbase5-dev qtchooser qtdeclarative5-dev qtfeedback5-dev qtlocation5-dev qtmultimedia5-dev qtpim5-dev qtsensors5-dev qtsystems5-dev 2&gt;/dev/null | grep -q '^i'" (output to follow)
  
  Make sure you have the following packages installed: 
  user@host:/opt/lampp/htdocs/hello$ 
  </code></pre>
  
  <p>looks already strange, since it warns me to install packages given an empty list.</p>
  
  <pre><code>$ cordova build
  No platforms added to this project. Please use `cordova platform add &lt;platform&gt;`.
  </code></pre>
  
  <p>... and it did not work.</p>
  
  <pre><code>$ cordova platforms ls
  
  Installed platforms: 
  Available platforms: amazon-fireos, android, blackberry10, firefoxos, ubuntu
  </code></pre>
  
  <p>looks like before.</p>
  
  <p>Any ideas?</p>
  
  <hr>
  
  <p>supplement:</p>
  
  <p>with</p>
  
  <pre><code>$ cordova -d platform add ubuntu
  </code></pre>
  
  <p>I get the following:</p>
  
  <pre><code>CordovaError: Make sure you have the following packages installed: 
  at /usr/lib/node_modules/cordova/node_modules/cordova-lib/src/cordova/metadata/ubuntu_parser.js:56:22
  at /usr/lib/node_modules/cordova/node_modules/cordova-lib/node_modules/shelljs/shell.js:1727:7
  at ChildProcess.exithandler (child_process.js:651:7)
  at ChildProcess.emit (events.js:98:17)
  at maybeClose (child_process.js:755:16)
  at Socket.&lt;anonymous&gt; (child_process.js:968:11)
  at Socket.emit (events.js:95:17)
  at Pipe.close (net.js:465:12)
  </code></pre>
  
  <hr>
  
  <p>supplement 2:</p>
  
  <p>Ok, I added all missing libraries by sudo apt-get install ......</p>
  
  <p>Now I get this:</p>
  
  <pre><code>$ cordova -d platform add ubuntu
  cordova library for "ubuntu" already exists. No need to download. Continuing.
  Checking if platform "ubuntu" passes minimum requirements...
  Checking ubuntu requirements...
  Running "dpkg-query -Wf'${db:Status-abbrev}' cmake debhelper libx11-dev libicu-dev pkg-config qtbase5-dev qtchooser qtdeclarative5-dev qtfeedback5-dev qtlocation5-dev qtmultimedia5-dev qtpim5-dev qtsensors5-dev qtsystems5-dev 2&gt;/dev/null | grep -q '^i'" (output to follow)
  
  Creating ubuntu project...
  Running command: /home/user/.cordova/lib/ubuntu/cordova/3.5.0/bin/create /opt/lampp/htdocs/hello/platforms/ubuntu com.example.hello HelloWorld
  Shelljs module was not found, running 'npm install'.....
  ERROR : running 'npm install' is npm installed? Error: Command failed: npm WARN package.json cordova-ubuntu@0.0.0 No README data
  npm ERR! Error: Attempt to unlock shelljs@0.2.6, which hasn't been locked
  npm ERR!     at unlock (/usr/lib/node_modules/npm/lib/utils/locker.js:44:11)
  npm ERR!     at cb (/usr/lib/node_modules/npm/lib/cache/add-named.js:32:5)
  npm ERR!     at /usr/lib/node_modules/npm/lib/cache/add-named.js:41:20
  npm ERR!     at /usr/lib/node_modules/npm/lib/utils/locker.js:30:7
  npm ERR!     at /usr/lib/node_modules/npm/node_modules/lockfile/lockfile.js:167:38
  npm ERR!     at OpenReq.Req.done (/usr/lib/node_modules/npm/node_modules/graceful-fs/graceful-fs.js:144:5)
  npm ERR!     at OpenReq.done (/usr/lib/node_modules/npm/node_modules/graceful-fs/graceful-fs.js:64:22)
  npm ERR!     at Object.oncomplete (fs.js:107:15)
  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 Linux 3.11.0-26-generic
  npm ERR! command "/usr/bin/node" "/usr/bin/npm" "install"
  npm ERR! cwd /home/user/.cordova/lib/ubuntu/cordova/3.5.0/bin
  npm ERR! node -v v0.10.29
  npm ERR! npm -v 1.4.14
  npm ERR! Error: Attempt to unlock elementtree@*, which hasn't been locked
  npm ERR!     at unlock (/usr/lib/node_modules/npm/lib/utils/locker.js:44:11)
  npm ERR!     at cb (/usr/lib/node_modules/npm/lib/cache/add-named.js:32:5)
  npm ERR!     at /usr/lib/node_modules/npm/lib/cache/add-named.js:41:20
  npm ERR!     at /usr/lib/node_modules/npm/lib/utils/locker.js:30:7
  npm ERR!     at /usr/lib/node_modules/npm/node_modules/lockfile/lockfile.js:167:38
  npm ERR!     at OpenReq.Req.done (/usr/lib/node_modules/npm/node_modules/graceful-fs/graceful-fs.js:144:5)
  npm ERR!     at OpenReq.done (/usr/lib/node_modules/npm/node_modules/graceful-fs/graceful-fs.js:64:22)
  npm ERR!     at Object.oncomplete (fs.js:107:15)
  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;
  
  ....[several other lines with similar errors].....
  
  Command finished with error code 1: /home/user/.cordova/lib/ubuntu/cordova/3.5.0/bin/create /opt/lampp/htdocs/hello/platforms/ubuntu,com.example.hello,HelloWorld
  Error: /home/user/.cordova/lib/ubuntu/cordova/3.5.0/bin/create: Command failed with exit code 1
  at ChildProcess.whenDone (/usr/lib/node_modules/cordova/node_modules/cordova-lib/src/cordova/superspawn.js:135:23)
  at ChildProcess.emit (events.js:98:17)
  at maybeClose (child_process.js:755:16)
  at Process.ChildProcess._handle.onexit (child_process.js:822:5)
  </code></pre>
  
  <p>And yes, npm IS installed</p>
  
  <p>solved by changing the ownership of /home/user/.npm from "root" to "user"</p>
  
  <p>Still, the next problem occurs:</p>
  
  <pre><code>$ cordova build
  Running command: /opt/lampp/htdocs/hello/platforms/ubuntu/cordova/build 
  /opt/lampp/htdocs/hello/platforms/ubuntu/cordova/check_reqs
  Error: missing dependency cmake libicu-dev pkg-config qtbase5-dev qtchooser qtdeclarative5-dev qtfeedback5-dev qtlocation5-dev qtmultimedia5-dev qtpim5-dev qtsensors5-dev qtsystems5-dev
  /opt/lampp/htdocs/hello/platforms/ubuntu/cordova/check_reqs FAILED
  Error: /opt/lampp/htdocs/hello/platforms/ubuntu/cordova/build: Command failed with exit code 1
  at ChildProcess.whenDone (/usr/lib/node_modules/cordova/node_modules/cordova-lib/src/cordova/superspawn.js:135:23)
  at ChildProcess.emit (events.js:98:17)
  at maybeClose (child_process.js:755:16)
  at Process.ChildProcess._handle.onexit (child_process.js:822:5)
  </code></pre>
  
  <p>And I DO have installed these:  cmake libicu-dev pkg-config qtbase5-dev qtchooser qtdeclarative5-dev qtfeedback5-dev qtlocation5-dev qtmultimedia5-dev qtpim5-dev qtsensors5-dev qtsystems5-dev</p>