Cordova CLI: 6.0.0 - Not detected, please help!

I’m Not 100% sure what happened, but earlier today I was running fine with the following environment:

Cordova CLI: 6.0.0
Ionic Version: 2.0.0-beta.3
Ionic CLI Version: 2.0.0-beta.19
Ionic App Lib Version: 2.0.0-beta.9
ios-deploy version: Not installed
ios-sim version: 5.0.6
OS: Mac OS X El Capitan
Node Version: v5.7.1
Xcode version: Xcode 7.2.1 Build version 7C1002

I then attempted to add the StatusBar plugin as I was having issues with the status bar overlapping, as discussed here: https://github.com/driftyco/ionic/issues/932#issuecomment-199068329. After adding the statusbar plugin, cordova would fail with permission errors. I removed the plugin again, and since everything has been a nightmare. I could no longer build any apps. Serve still works 100%. Anything cordova related failed.

Reverting to Cordova CLI 4.2.0 enabled me to build again. Updating the CLI to 6.0.0 would appear to be successful, however, upon trying cordova -v - nothing would appear, and would appear as Not Installed using ionic info.

I’ve since downgraded to Node v 4.4.0, however, still having exact same issues. It would seem that Ionic is not picking up the location of Cordova 6. Is there anything I can do? This app was inline to be released by the end of the week but now I’m getting nervous!

For extra info, the same issue is referenced here: https://github.com/driftyco/ionic-cli/issues/756

In my case running sudo npm -g list | grep cordova results in:
├─┬ cordova@6.0.0 │ ├─┬ cordova-lib@6.0.0 │ │ ├── cordova-app-hello-world@3.10.0 │ │ ├─┬ cordova-common@1.0.0 │ │ ├─┬ cordova-js@4.1.3 │ │ ├── cordova-registry-mapper@1.1.14 │ │ ├─┬ cordova-serve@1.0.0 │ │ ├─┬ ionic-cordova-lib@5.1.10 │ │ │ ├── cordova-app-hello-world@3.9.0 │ │ │ ├─┬ cordova-js@4.0.0 │ │ │ ├── cordova-registry-mapper@1.1.15 │ │ │ ├─┬ cordova-serve@0.1.3

Not sure if I’ll ever understand why it happened by my resolution was to remove cordova and ionic from npm. Then remove node completely.

Re-installed node using homebrew and fixed symlinks.
Installed cordova and ionic as sudo: sudo npm install -g cordova ionic@beta
Deleted original platforms folder
Manually added platforms again without sudo: ionic platform add ios
Built each platform without sudo: ionic build ios
Took ownership of all files in home directory: sudo chown -R username /Users/username (as suggested here: http://zacvineyard.com/blog/2015/11/ionic-invalid-device-state-error-with-xcode-7-solved)
Ran the emulator, and it all just worked. Hopefully I can come back to the StatusBar issue in the future, but for now I’m happy.

1 Like

Thanks to all, solve my problem!