Skip to content
This repository was archived by the owner on Apr 11, 2022. It is now read-only.
This repository was archived by the owner on Apr 11, 2022. It is now read-only.

Cannot serve newly created app #832

@damon-hall

Description

@damon-hall

PhoneGap CLI, node & npm versions

phonegap: 9.0.0
node: 12.18.0
npm: 6.14.4

Expected Behaviour

Should be able to serve a newly created phonegap app

Actual Behaviour

Fails to serve newly created phonegap app with errors (below)

Steps to Reproduce

  1. npm i -g phonegap@latest (assuming 9.0.0 is still the latest version)
  2. phonegap create myApp
  3. cd ./myApp
  4. phonegap serve
  5. And connect using phonegap developer app

Sample Code that illustrates the problem

N/A - Default code from create (unchanged)

Error messages

Failed to install 'cordova-plugin-device': Error: Cannot find module 'glob'
Require stack:
- D:\Personal\myApp\node_modules\cordova-common\src\ConfigChanges\ConfigFile.js
- D:\Personal\myApp\node_modules\cordova-common\src\ConfigChanges\ConfigKeeper.js
- D:\Personal\myApp\node_modules\cordova-common\src\ConfigChanges\ConfigChanges.js
- D:\Personal\myApp\node_modules\cordova-common\cordova-common.js
- D:\Personal\myApp\node_modules\cordova-browser\bin\template\cordova\Api.js
- C:\Users\daveh\AppData\Roaming\npm\node_modules\phonegap\node_modules\cordova-lib\src\cordova\util.js
- C:\Users\daveh\AppData\Roaming\npm\node_modules\phonegap\node_modules\cordova-lib\src\platforms\platforms.js
- C:\Users\daveh\AppData\Roaming\npm\node_modules\phonegap\node_modules\cordova-lib\src\plugman\install.js
- C:\Users\daveh\AppData\Roaming\npm\node_modules\phonegap\node_modules\cordova-lib\src\plugman\plugman.js
- C:\Users\daveh\AppData\Roaming\npm\node_modules\phonegap\node_modules\cordova-lib\cordova-lib.js
- C:\Users\daveh\AppData\Roaming\npm\node_modules\phonegap\node_modules\cordova\src\help.js
- C:\Users\daveh\AppData\Roaming\npm\node_modules\phonegap\node_modules\cordova\src\cli.js
- C:\Users\daveh\AppData\Roaming\npm\node_modules\phonegap\node_modules\cordova\bin\cordova
    at Function.Module._resolveFilename (internal/modules/cjs/loader.js:966:15)
    at Function.Module._load (internal/modules/cjs/loader.js:842:27)
    at Module.require (internal/modules/cjs/loader.js:1026:19)
    at Object.get (D:\Personal\myApp\node_modules\cordova-common\src\util\addProperty.js:26:44)
    at resolveConfigFilePath (D:\Personal\myApp\node_modules\cordova-common\src\ConfigChanges\ConfigFile.js:224:31)
    at ConfigFile_load [as load] (D:\Personal\myApp\node_modules\cordova-common\src\ConfigChanges\ConfigFile.js:60:36)
    at new ConfigFile (D:\Personal\myApp\node_modules\cordova-common\src\ConfigChanges\ConfigFile.js:51:10)
    at ConfigKeeper_get [as get] (D:\Personal\myApp\node_modules\cordova-common\src\ConfigChanges\ConfigKeeper.js:51:23)
    at PlatformMunger_apply_file_munge [as apply_file_munge] (D:\Personal\myApp\node_modules\cordova-common\src\ConfigChanges\ConfigChanges.js:78:50)
    at munge_helper (D:\Personal\myApp\node_modules\cordova-common\src\ConfigChanges\ConfigChanges.js:238:14)
Installing "cordova-plugin-vibration" for browser

(node:6468) UnhandledPromiseRejectionWarning: Error [ERR_UNHANDLED_ERROR]: Unhandled error. ('The platform "browser" does not appear to be a valid cordova platform. It is missing API.js. browser not supported.')
    at CordovaEventEmitter.emit (events.js:304:17)
    at CordovaEventEmitter.emit (C:\Users\daveh\AppData\Roaming\npm\node_modules\phonegap\node_modules\cordova-common\src\events.js:69:22)
    at Object.getPlatformApiFunction (C:\Users\daveh\AppData\Roaming\npm\node_modules\phonegap\node_modules\cordova-lib\src\cordova\util.js:384:20)
    at Object.getPlatformApi (C:\Users\daveh\AppData\Roaming\npm\node_modules\phonegap\node_modules\cordova-lib\src\platforms\platforms.js:55:32)
    at C:\Users\daveh\AppData\Roaming\npm\node_modules\phonegap\node_modules\cordova-lib\src\cordova\prepare.js:52:38
    at Array.map (<anonymous>)
    at C:\Users\daveh\AppData\Roaming\npm\node_modules\phonegap\node_modules\cordova-lib\src\cordova\prepare.js:50:47
    at processTicksAndRejections (internal/process/task_queues.js:97:5)
(node:6468) UnhandledPromiseRejectionWarning: Unhandled promise rejection. This error originated either by throwing inside of an async function without a catch block, or by rejecting a promise which was not handled with .catch(). To terminate the node process on unhandled promise rejection, use the CLI flag `--unhandled-rejections=strict` (see https://nodejs.org/api/cli.html#cli_unhandled_rejections_mode). (rejection id: 1)
(node:6468) [DEP0018] DeprecationWarning: Unhandled promise rejections are deprecated. In the future, promise rejections that are not handled will terminate the Node.js process with a non-zero exit code.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions