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

前端 未结 14 2249
逝去的感伤
逝去的感伤 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:18

    I also had the same problem. i had an angular project. then created a cordova app inside called mobile

    cordova create mobile
    

    Then i tried to run

    cordova platform add android
    

    Which gave me the same error 'Current working directory is not a Cordova-based project'.

    Solution : i have to go to the mobile folder ( from the command prompt cd mobile ) then i had to run the command there. Also there had to be a www folder in that mobile folder

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

    Create www folder on root directory. If still it's a issue check ionic info and try to upgrade

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

    You have to be in a project before you launch cordova plugin search bar code.

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

    This may be silly but in my case it was the config.xml file.

    I usually create it dynamically using a script, therefor it wasn't there after I cloned the repo. Ran the script to re-create it and everything worked again.

    0 讨论(0)
  • 2020-12-30 20:21
    ionic integrations enable --add
    

    then run the

    ionic build
    

    it will add all the necessary files

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

    Happened to me also, probably from npm/node updates.

    Worked for me the following:

    npm install -g cordova

    ionic cordova platform list

    0 讨论(0)
提交回复
热议问题