"Could not install from xxx as it does not contain package.json file"


#1

I have the following error, already tried a lot of things, a friend added a map to the test app (started using google maps plugin), and then I can not work on the project any more.
Ionic 3.12
Cordova 7.0.1
Npm 5.3.0
The friend has the same settings(works fine for him)

    $npm install
    npm ERR! code ENOLOCAL
    npm ERR! Could not install from "..\..\..\..\..\..\cordova-plugin-googlemaps-master" as it does not 
    contain     a  package.json file.
    npm ERR! A complete log of this run can be found in:
    npm ERR!     C:\Users\xxxx\AppData\Roaming\npm-cache\_logs\2017-10-01T02_51_15_049Z-
    debug.log

please help!


#2

Did you try to uninstall and reinstall it? If not, do so and don’t run ionic cordova add plugin, try dropping ionic from the command. And make sure you add your API key as a variable.

cordova plugin add https://github.com/mapsplugin/cordova-plugin-googlemaps  --variable API_KEY_FOR_IOS="*******" --variable API_KEY_FOR_ANDROID="********"

#3

Yes i tried.When i run that command i get “Error: Current working directory is not a Cordova-based project.”


#4

Ohhh. You might need to uninstall and reinstall your node_modules, JUST for that project.

Whenever that issue came up for me I just bit the bullet and copied my files over to a new project.


#5

Another possibility is that you need to uninstall and reinstall your iOS platform, and push to your Ionic git. I ran into the same problem today and that did the trick for me. If you’re not dealing with iOS platform issues, maybe some version of this action can help in your circumstance.


#6

What commands are you executing? This looks really wrong.

Also post your ionic info output please.