Issues installing Cordova using npm install


#1

I have just got started with Ionic and as much as it is awesome I am having a few issues installing the Cordova side of things.

when I try to install Cordova using npm install -g cordova I get the following errors and cannot get past it. I have tried sudo too. Has anyone else hit this issue?

Leighs-MacBook-Pro:myapp leigh$ sudo npm install -g cordova
Password:
npm WARN engine npm@1.3.4: wanted: {“node”:">=0.6",“npm”:“1”} (current: {“node”:“0.10.38”,“npm”:“2.9.0”})
npm WARN installMany normalize-package-data was bundled with npm@1.3.4, but bundled package wasn’t found in unpacked tree
npm ERR! Darwin 14.3.0
npm ERR! argv “node” “/Users/leigh/.nvm/v0.10.38/bin/npm” “install” “-g” "cordova"
npm ERR! node v0.10.38
npm ERR! npm v2.9.0
npm ERR! code ETARGET

npm ERR! notarget No compatible version found: JSONStream@’>=1.0.3 <2.0.0’
npm ERR! notarget Valid install targets:
npm ERR! notarget [“0.0.0”,“0.1.0”,“0.1.1”,“0.1.2”,“0.1.3”,“0.2.0”,“0.2.1”,“0.2.2”,“0.2.3”,“0.3.0”,“0.3.1”,“0.3.2”,“0.3.3”,“0.4.0”,“0.4.1”,“0.4.2”,“0.4.3”,“0.4.4”,“0.5.0”,“0.6.0”,“0.6.1”,“0.6.2”,“0.6.3”,“0.6.4”,"0.7.


#2

Confirmed, running into this here too. Looks like a problem with Cordova though, not Ionic.


#3

This is my first day of using Ionic, can I just continue without Cordova in my project and then install it once I have found an answer to this do you think?


#4

I don’t think you’ll be able to create a new Ionic project without Cordova properly installed.


#5

Same here:

Venkateswaras-MacBook-Pro:~ venkatpolisetti$ sudo npm install -g ionic cordova
npm WARN engine npm@1.3.4: wanted: {“node”:">=0.6",“npm”:“1”} (current: {“node”:“0.12.2”,“npm”:“2.7.4”})
npm WARN engine cordova-js@3.9.0: wanted: {“node”:"~0.10.x"} (current: {“node”:“0.12.2”,“npm”:“2.7.4”})
npm WARN engine xmlbuilder@2.2.1: wanted: {“node”:“0.8.x || 0.10.x”} (current: {“node”:“0.12.2”,“npm”:“2.7.4”})
npm WARN installMany normalize-package-data was bundled with npm@1.3.4, but bundled package wasn’t found in unpacked tree
/usr/local/bin/ionic -> /usr/local/lib/node_modules/ionic/bin/ionic
npm ERR! Darwin 14.3.0
npm ERR! argv “node” “/usr/local/bin/npm” “install” “-g” “ionic” "cordova"
npm ERR! node v0.12.2
npm ERR! npm v2.7.4
npm ERR! code ETARGET

npm ERR! notarget No compatible version found: JSONStream@’>=1.0.3 <2.0.0’
npm ERR! notarget Valid install targets:
npm ERR! notarget [“0.0.0”,“0.1.0”,“0.1.1”,“0.1.2”,“0.1.3”,“0.2.0”,“0.2.1”,“0.2.2”,“0.2.3”,“0.3.0”,“0.3.1”,“0.3.2”,“0.3.3”,“0.4.0”,“0.4.1”,“0.4.2”,“0.4.3”,“0.4.4”,“0.5.0”,“0.6.0”,“0.6.1”,“0.6.2”,“0.6.3”,“0.6.4”,“0.7.0”,“0.7.1”,“0.8.0”,“0.7.2”,“0.7.3”,“0.7.4”,“0.8.1”,“0.8.2”,“0.8.3”,“0.8.4”,“0.9.0”,“0.10.0”]
npm ERR! notarget
npm ERR! notarget This is most likely not a problem with npm itself.
npm ERR! notarget In most cases you or one of your dependencies are requesting
npm ERR! notarget a package version that doesn’t exist.
npm ERR! notarget
npm ERR! notarget It was specified as a dependency of 'deps-sort’
npm ERR! notarget

npm ERR! Please include the following file with any support request:
npm ERR! /Users/venkatpolisetti/npm-debug.log
Venkateswaras-MacBook-Pro:~ venkatpolisetti$


#6

Probably best to keep an eye on:

http://stackoverflow.com/questions/30107474/error-installing-cordova


#7

Checking this out right now. According to the issue tracker, it should be fixed but I’m not sure if has been released yet. Will follow up on this.

https://issues.apache.org/jira/browse/CB-8985


#8

Should be good now folks.


#9

Try this if this helps
sudo npm install -g cordova@4.0.0 and update later.


#10

Nor this works:
sudo npm install -g cordova@4.0.0
npm WARN engine npm@1.3.4: wanted: {“node”:">=0.6",“npm”:“1”} (current: {“node”:“0.12.3”,“npm”:“2.10.1”})
npm WARN engine cordova-js@3.7.1: wanted: {“node”:"~0.10.x"} (current: {“node”:“0.12.3”,“npm”:“2.10.1”})
npm WARN engine xmlbuilder@2.2.1: wanted: {“node”:“0.8.x || 0.10.x”} (current: {“node”:“0.12.3”,“npm”:“2.10.1”})
npm WARN installMany normalize-package-data was bundled with npm@1.3.4, but bundled package wasn’t found in unpacked tree
/usr/local/bin/cordova -> /usr/local/lib/node_modules/cordova/bin/cordova
npm WARN unmet dependency /usr/local/lib/node_modules/ionic/node_modules/ionic-app-lib/node_modules/cordova-lib/node_modules/cordova-js/node_modules/browserify requires through2@’^1.0.0’ but will load
npm WARN unmet dependency /usr/local/lib/node_modules/ionic/node_modules/ionic-app-lib/node_modules/cordova-lib/node_modules/through2,
npm WARN unmet dependency which is version 0.6.3
npm WARN unmet dependency /usr/local/lib/node_modules/ionic/node_modules/ionic-app-lib/node_modules/cordova-lib/node_modules/cordova-js/node_modules/uglify-js requires async@’~0.2.6’ but will load
npm WARN unmet dependency /usr/local/lib/node_modules/ionic/node_modules/async,
npm WARN unmet dependency which is version 0.9.0
cordova@4.0.0 /usr/local/lib/node_modules/cordova
├── q@0.9.7
├── underscore@1.4.4
├── nopt@2.2.1 (abbrev@1.0.6)
└── cordova-lib@4.0.0 (osenv@0.0.3, properties-parser@0.2.3, mime@1.2.11, bplist-parser@0.0.5, unorm@1.3.3, semver@2.0.11, shelljs@0.3.0, dep-graph@1.1.0, elementtree@0.1.5, xcode@0.6.7, d8@0.4.4, rc@0.3.0, npmconf@0.1.16, glob@3.2.11, plist@1.0.1, npm@1.3.4, tar@0.1.20, request@2.22.0, cordova-js@3.7.1)


#11

So to recap … ionic complains if you’re using node 0.10.x (it wants 0.12.x), however it depends on cordova 4.0.0 which wants Node 0.10.x - so we cannot currently install cordova and ionic. Installing cordova 4.0.0 does not fix this. So can you please advise which version of cordova you tested ionic 1.0.1 with?


#12

This installs ionic … But when running ionic it just freezes (no error) so it looks like we just ignore the warning in ionic and use Node 0.10.x instead - it works. If so then this is an ionic issue not a Cordova one.
Platform: Windows 7 SP1, node 0.12.7 32 bit, npm 2.11.3

$ npm install -g ionic
npm WARN engine cordova-js@4.0.0: wanted: {“node”:"~0.10.x"} (current: {“node”:“0.12.7”,“npm”:“2.11.3”})
npm WARN engine npm@1.3.4: wanted: {“node”:">=0.6",“npm”:“1”} (current: {“node”:“0.12.7”,“npm”:“2.11.3”})
npm WARN engine xmlbuilder@2.2.1: wanted: {“node”:“0.8.x || 0.10.x”} (current: {“node”:“0.12.7”,“npm”:“2.11.3”})
npm WARN installMany normalize-package-data was bundled with npm@1.3.4, but bundled package wasn’t found in unpacked tree
c:\Program Files\nodejs\ionic -> c:\Program Files\nodejs\node_modules\ionic\bin\ionic
ionic@1.6.1 c:\Program Files\nodejs\node_modules\ionic


#13

I did use npm cache clean but this was only fixed for me :smiley: by doing npm uninstall -g cordova ionic and then reinstalling npm install -g ionic (which installs cordova).


#14

I am working on windows 10 and previously I installed Cordova alone. I had the same problem with the command:
npm install -g cordova ionic

What I did:

  1. I uninstalled Node js (x64) and Installed the (x32) version
  2. Installed the latest Git for Windows.
  3. Using the Git Bash enter: npm install -g ionic
  4. Then : npm install -g cordova
  5. ionic start “your app name”
  6. cd "your app name"
    7.ionic serve

Now your app should be up and running in your localhost link.