Cordova is not a valid task googlemap native

i am trying to install googlemap native using the following command.

sudo ionic cordova plugin add --variable API_KEY_FOR_ANDROID="api key is written here" --variable API_KEY_FOR_IOS="api key is written here"

and i am getting is cordova is not valid task.
cordova version 6.5.0

1 Like

i also tried it without sudo.
but no luck.

Post your ionic info output please.
Also run npm list -g --depth=0 please.

Cordova CLI: 6.5.0
Ionic Framework Version: 3.6.0
Ionic CLI Version: 2.2.2
Ionic App Lib Version: 2.2.1
Ionic App Scripts Version: 2.1.3
ios-deploy version: Not installed
ios-sim version: Not installed
OS: Linux 3.13
Node Version: v7.9.0
Xcode version: Not installed

β”œβ”€β”€ bower@1.8.0
β”œβ”€β”€ cordova@6.5.0
β”œβ”€β”€ express@4.15.3
β”œβ”€β”€ gulp@3.9.1
β”œβ”€β”€ ionic@2.2.2
β”œβ”€β”€ localtunnel@1.8.2
β”œβ”€β”€ loopback-cli@2.5.0
β”œβ”€β”€ n@2.1.7
β”œβ”€β”€ node-inspector@1.1.1
β”œβ”€β”€ nodemon@1.11.0
β”œβ”€β”€ npm@4.2.0
β”œβ”€β”€ swagger@0.7.5
β”œβ”€β”€ typescript@2.0.0
└── typings@2.1.1

You would benefit greatly by installing a recent 3.x version of this - this would also better check for Cordova etc.

ok thanks i will look into it. if i have any issue then i will report back.

A post was split to a new topic: Mapsplugin/cordova-plugin-googlemaps#multiple_maps: Failed to get absolute path to installed module

Maybe a stupid question, but you changed out all your api keys right? If not your best bet is either updating, or uninstalling and reinstalling your packages.

Please realize that running ionic under sudo even once is something that is likely to damage the permissions on various places in your project. It’s not something that should ever be done, and certainly not on a whim. Once you’ve done it once, you must repair all permission damage before taking any further action, or else you have no way of knowing whether it was your earlier use of sudo that caused whatever problem you are now seeing.