Cannot run app on device [solved]

When I run the command ionic run android --device it seems the build is started but the app isn’t started on my device. adb devices lists my device and USB Debugging is enabled. There is no error message. Only the output below:

> ionic-hello-world@ ionic:build C:\Projects\web\Ionic2CLI-Meteor-WhatsApp
> ionic-app-scripts build "--device"

[20:45:34]  ionic-app-scripts 1.0.0
[20:45:34]  build dev started ...
[20:45:34]  clean started ...
[20:45:34]  clean finished in 1 ms
[20:45:34]  copy started ...
[20:45:34]  transpile started ...
[20:45:38]  transpile finished in 4.08 s
[20:45:38]  webpack started ...
[20:45:39]  copy finished in 4.41 s
[20:45:53]  webpack finished in 15.16 s
[20:45:53]  sass started ...
[20:45:56]  sass finished in 2.22 s
[20:45:56]  build dev finished in 21.49 s

There is also no .apk created. There is a folder platforms\android but no subfolder build. The command ionic build android give me the same result as described above.

I don’t know why but running npm install -g cordovaagain fixed the problem. I had cordova installed before and I also tried it on the command line.
Now I’m getting this warning but it works.

******************************************************
 Dependency warning - for the CLI to run correctly,
 it is highly recommended to install/upgrade the following:

 Please install your Cordova CLI to version  >=4.2.0 `npm install -g cordova`

******************************************************

cordova --version 
6.5.0