apache / cordova-paramedic

Apache Cordova - Paramedic
https://cordova.apache.org/
Apache License 2.0
36 stars 53 forks source link

Project creation just swallows missing `cordova` #185

Open janpio opened 5 years ago

janpio commented 5 years ago

Current error handling seems to me majorly lacking, running e.g. npm run test-windows without having cordova installed at all just happily chucks along until it has to install a plugin:

E:\Projects\Cordova\cordova-paramedic (janpio-windows -> origin) (cordova-paramedic@1.0.0-dev)
λ npm run test-windows

> cordova-paramedic@1.0.0-dev test-windows E:\Projects\Cordova\cordova-paramedic
> node main.js --platform windows --plugin ./spec/testable-plugin/

---------------------------------------------------------
0. Paramedic config
   - platform: windows
   - action: run
   - args:
   - plugins: ./spec/testable-plugin/
   - useTunnel: false
   - verbose: false
   - cleanUpAfterRun: false
   - shouldUseSauce: false
---------------------------------------------------------
cordova-paramedic: Will use the following cli: cordova
---------------------------------------------------------
1. Create Cordova app with platform and plugin(s) to test
- platform: windows
- plugin(s): ./spec/testable-plugin/
---------------------------------------------------------
cordova-paramedic: creating temp project at C:\Users\Admin\AppData\Local\Temp\tmp-234236LO6J5pQGrUbS
$ cordova create C:\Users\Admin\AppData\Local\Temp\tmp-234236LO6J5pQGrUbS --no-telemetry --no-update-notifier
C:\Users\Admin\AppData\Local\Temp\tmp-234236LO6J5pQGrUbS E:\Projects\Cordova\cordova-paramedic
cordova-paramedic: installing plugins
cordova-paramedic: installing plugin E:\Projects\Cordova\cordova-paramedic\spec\testable-plugin --no-telemetry --no-update-notifier
$ cordova plugin add E:\Projects\Cordova\cordova-paramedic\spec\testable-plugin --no-telemetry --no-update-notifier
Error: Failed to install plugin : E:\Projects\Cordova\cordova-paramedic\spec\testable-plugin --no-telemetry --no-update-notifier
Error: Failed to install plugin : E:\Projects\Cordova\cordova-paramedic\spec\testable-plugin --no-telemetry --no-update-notifier
Error: Failed to install plugin : E:\Projects\Cordova\cordova-paramedic\spec\testable-plugin --no-telemetry --no-update-notifier
    at PluginsManager.installSinglePlugin (E:\Projects\Cordova\cordova-paramedic\lib\PluginsManager.js:89:19)
    at PluginsManager.installPlugins (E:\Projects\Cordova\cordova-paramedic\lib\PluginsManager.js:35:18)
    at ParamedicApp.installPlugins (E:\Projects\Cordova\cordova-paramedic\lib\ParamedicApp.js:68:24)
    at ParamedicApp.prepareProjectToRunTests (E:\Projects\Cordova\cordova-paramedic\lib\ParamedicApp.js:59:14)
    at E:\Projects\Cordova\cordova-paramedic\lib\paramedic.js:70:33
From previous event:
    at ParamedicRunner.run (E:\Projects\Cordova\cordova-paramedic\lib\paramedic.js:79:14)
    at Object.exports.run (E:\Projects\Cordova\cordova-paramedic\lib\paramedic.js:510:19)
    at Object.<anonymous> (E:\Projects\Cordova\cordova-paramedic\main.js:184:15)
    at Module._compile (internal/modules/cjs/loader.js:776:30)
    at Object.Module._extensions..js (internal/modules/cjs/loader.js:787:10)
    at Module.load (internal/modules/cjs/loader.js:643:32)
    at Function.Module._load (internal/modules/cjs/loader.js:556:12)
    at Function.Module.runMain (internal/modules/cjs/loader.js:839:10)
---------------------------------------------------------
6. Collect data and clean up
---------------------------------------------------------
Completed tests at 12:22:33 with result: undefined
Collecting logs for the devices.
Uninstalling the app.
Error: Error: Failed to install plugin : E:\Projects\Cordova\cordova-paramedic\spec\testable-plugin --no-telemetry --no-update-notifier
    at E:\Projects\Cordova\cordova-paramedic\lib\paramedic.js:99:23
    at processTicksAndRejections (internal/process/task_queues.js:72:11)
From previous event:
    at ParamedicRunner.run (E:\Projects\Cordova\cordova-paramedic\lib\paramedic.js:96:19)
    at Object.exports.run (E:\Projects\Cordova\cordova-paramedic\lib\paramedic.js:510:19)
    at Object.<anonymous> (E:\Projects\Cordova\cordova-paramedic\main.js:184:15)
    at Module._compile (internal/modules/cjs/loader.js:776:30)
    at Object.Module._extensions..js (internal/modules/cjs/loader.js:787:10)
    at Module.load (internal/modules/cjs/loader.js:643:32)
    at Function.Module._load (internal/modules/cjs/loader.js:556:12)
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! cordova-paramedic@1.0.0-dev test-windows: `node main.js --platform windows --plugin ./spec/testable-plugin/`npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the cordova-paramedic@1.0.0-dev test-windows script.
npm ERR! This is probably not a problem with npm. There is likely additional logging output above.

npm ERR! A complete log of this run can be found in:
npm ERR!     C:\Users\Admin\AppData\Roaming\npm-cache\_logs\2019-07-03T10_22_33_401Z-debug.log

E:\Projects\Cordova\cordova-paramedic (janpio-windows -> origin) (cordova-paramedic@1.0.0-dev)
λ cordova -v
'cordova' is not recognized as an internal or external command,
operable program or batch file.

The initial cordova create should fail here already.