Cordova - Current working directory is not a Cordova-based project

前端 未结 14 2250
逝去的感伤
逝去的感伤 2020-12-30 19:56

I\'m using phonegap for my mobile project. My question is why I got this error when I try to search phonegap plugin using cordova CLI? I run this command in terminal to sear

相关标签:
14条回答
  • 2020-12-30 20:32

    I cannot explain the source of the error, but in case you are looking for a solution, you might want to try plugman instead.

    0 讨论(0)
  • 2020-12-30 20:32

    you have to be in the current project in command prompt(example project name is myapp).

    example screen shot

    0 讨论(0)
  • 2020-12-30 20:33

    Did you come here because your Azure DevOps (fka VSO/VSTS) Cordova build pipe task failed with "Current working directory is not a Cordova-based project"?

    Resolved by creating the required (and missing) folder 'www\', with a powershell having script:

    New-Item -ItemType directory -Path www\

    0 讨论(0)
  • 2020-12-30 20:35

    If you are getting this error on Ionic2
    This issue generally occur when we just clone / download app and try to add platform to it.

    its very easy to resolve, then here are the steps-

    just create a "www" directory in application root.

    "./www"
    

    can also do by this command-

    mkdir www
    

    now we can easily run following command -

    ionic platform add android
    or
    ionic platform add ios
    

    Hope it will help!!!

    0 讨论(0)
  • 2020-12-30 20:37

    Yes, as QuickFix said, you need to be in a Cordova project before being able to use most of cordova Commands. If you are curious about what defines a Cordova project, this is what I found:

    • Has a .cordova directory, with a config.json inside.
    • Has a www directory, with a config.xml inside.
    • Has a platforms directory.

    With that in place you can use Cordoba commands without problem. If you need examples of those config files just run cordova create myapp.

    0 讨论(0)
  • 2020-12-30 20:37
    1. run ionic serve
    2. It will create www folder
    3. Then run cordova prepare
    0 讨论(0)
提交回复
热议问题