Uncaught (in promise): cordova_not_available in Ionic 2

前端 未结 8 1478
情书的邮戳
情书的邮戳 2020-12-13 12:33

When I\'m running my Ionic app with ionic serve -l command, get following error message:

Runtime Error

Unca

8条回答
  •  死守一世寂寞
    2020-12-13 13:02

    Using cordova simulator helps prevent Error: Uncaught (in promise): cordova_not_available.

    - Install cordova simulator

    npm install -g cordova-simulate
    

    - Run cordova simulator:

    • From the command line anywhere within a Cordova project, enter the following:

      simulate [platform] [--target=browser]

    • platform is any Cordova platform that has been added to your project. Defaults to browser.

    • browser is the name of the browser to launch your app in. Can be any of the following: default, chrome, chromium, edge, firefox, ie, opera, safari.

    Example:

    simulate android --target=chrome
    

    The above command will opens 2 tabs in chrome browser with the following URLs and ports:

    1. http://localhost:8000/simulator/index.html
    2. http://localhost:8000/index.html

    You can use simulator tab for changing and simulating device conditions such as GPS coordinates, internet connection type, device orientation, etc. and you can use other tab to test your app.

提交回复
热议问题