An error occurred while running cordova prepare android (exit code 1). when Testing as a native app

debug.log

10 verbose cache add spec https://github.com/apache/cordova-plugin-statusbar.git
11 silly cache add parsed spec Result {
11 silly cache add raw: ‘https://github.com/apache/cordova-plugin-statusbar.git’,
11 silly cache add scope: null,
11 silly cache add escapedName: null,
11 silly cache add name: null,
11 silly cache add rawSpec: ‘https://github.com/apache/cordova-plugin-statusbar.git’,
11 silly cache add spec: ‘git+https://github.com/apache/cordova-plugin-statusbar.git’,
11 silly cache add type: ‘hosted’,
11 silly cache add hosted:
11 silly cache add { type: ‘github’,
11 silly cache add ssh: ‘git@github.com:apache/cordova-plugin-statusbar.git’,
11 silly cache add sshUrl: ‘git+ssh://git@github.com/apache/cordova-plugin-statusbar.git’,
11 silly cache add httpsUrl: ‘git+https://github.com/apache/cordova-plugin-statusbar.git’,
11 silly cache add gitUrl: ‘git://github.com/apache/cordova-plugin-statusbar.git’,
11 silly cache add shortcut: ‘github:apache/cordova-plugin-statusbar’,
11 silly cache add directUrl: ‘https://raw.githubusercontent.com/apache/cordova-plugin-statusbar/master/package.json’ } }
12 verbose addRemoteGit caching https://github.com/apache/cordova-plugin-statusbar.git
13 verbose addRemoteGit git+https://github.com/apache/cordova-plugin-statusbar.git is a repository hosted by github
14 silly tryClone cloning git+https://github.com/apache/cordova-plugin-statusbar.git via git+https://github.com/apache/cordova-plugin-statusbar.git
15 verbose tryClone git-https-github-com-apache-cordova-plugin-statusbar-git-c66a3d92 not in flight; caching
16 verbose correctMkdir C:\Users\PC\AppData\Roaming\npm-cache_git-remotes correctMkdir not in flight; initializing
17 info git [ ‘config’, ‘–get’, ‘remote.origin.url’ ]
18 silly validateExistingRemote git+https://github.com/apache/cordova-plugin-statusbar.git remote.origin.url: https://github.com/apache/cordova-plugin-statusbar.git
19 verbose validateExistingRemote git+https://github.com/apache/cordova-plugin-statusbar.git is updating existing cached remote C:\Users\PC\AppData\Roaming\npm-cache_git-remotes\git-https-github-com-apache-cordova-plugin-statusbar-git-c66a3d92
20 info git [ ‘fetch’, ‘-a’, ‘origin’ ]
21 error git fetch -a origin (https://github.com/apache/cordova-plugin-statusbar.git) fatal: Unable to find remote helper for 'https’
22 silly fetchPackageMetaData Error: Command failed: git -c core.longpaths=true fetch -a origin
22 silly fetchPackageMetaData fatal: Unable to find remote helper for 'https’
22 silly fetchPackageMetaData
22 silly fetchPackageMetaData at ChildProcess.exithandler (child_process.js:204:12)
22 silly fetchPackageMetaData at emitTwo (events.js:106:13)
22 silly fetchPackageMetaData at ChildProcess.emit (events.js:191:7)
22 silly fetchPackageMetaData at maybeClose (internal/child_process.js:886:16)
22 silly fetchPackageMetaData at Process.ChildProcess._handle.onexit (internal/child_process.js:226:5)
22 silly fetchPackageMetaData error for https://github.com/apache/cordova-plugin-statusbar.git { Error: Command failed: git -c core.longpaths=true fetch -a origin
22 silly fetchPackageMetaData fatal: Unable to find remote helper for 'https’
22 silly fetchPackageMetaData
22 silly fetchPackageMetaData at ChildProcess.exithandler (child_process.js:204:12)
22 silly fetchPackageMetaData at emitTwo (events.js:106:13)
22 silly fetchPackageMetaData at ChildProcess.emit (events.js:191:7)
22 silly fetchPackageMetaData at maybeClose (internal/child_process.js:886:16)
22 silly fetchPackageMetaData at Process.ChildProcess._handle.onexit (internal/child_process.js:226:5)
22 silly fetchPackageMetaData killed: false,
22 silly fetchPackageMetaData code: 128,
22 silly fetchPackageMetaData signal: null,
22 silly fetchPackageMetaData cmd: ‘git -c core.longpaths=true fetch -a origin’ }
23 silly rollbackFailedOptional Starting
24 silly rollbackFailedOptional Finishing
25 silly runTopLevelLifecycles Finishing
26 silly install printInstalled
27 verbose stack Error: Command failed: git -c core.longpaths=true fetch -a origin
27 verbose stack fatal: Unable to find remote helper for 'https’
27 verbose stack
27 verbose stack at ChildProcess.exithandler (child_process.js:204:12)
27 verbose stack at emitTwo (events.js:106:13)
27 verbose stack at ChildProcess.emit (events.js:191:7)
27 verbose stack at maybeClose (internal/child_process.js:886:16)
27 verbose stack at Process.ChildProcess._handle.onexit (internal/child_process.js:226:5)
28 verbose cwd C:\Users\PC\Desktop\coolApp
29 error Windows_NT 10.0.14393
30 error argv “C:\Program Files\nodejs\node.exe” “C:\Program Files\nodejs\node_modules\npm\bin\npm-cli.js” “install” “https://github.com/apache/cordova-plugin-statusbar.git” “–production” "–no-save"
31 error node v6.10.3
32 error npm v3.10.10
33 error code 128
34 error Command failed: git -c core.longpaths=true fetch -a origin
34 error fatal: Unable to find remote helper for 'https’
35 error If you need help, you may report this error at:
35 error https://github.com/npm/npm/issues
36 verbose exit [ 1, true ]

One solution: Uninstall your node, install nvm (or nvm-windows if you are on Windows), install a new node (which includes npm) with this, then install ionic and cordova again and try your command again. The problem should be gone.