Not able to create database in desktop app

I am creating a Desktop app(Electron) with Ionic4 for windows 10 with sqlitedb (OFFLINE DB) but I am not able to create db.
Whenever I call createdb, it is throwing “ERROR Error: Uncaught (in promise): TypeError: Cannot read property ‘then’ of undefined”.

Here is the code snippet –

      name: 'data.db',
      location: 'default'
      .then((db: SQLiteObject) => {
        db.executeSql('create table danceMoves(name VARCHAR(32))', [])
          .then(() => console.log('Executed SQL'))
          .catch(e => console.log(e));

      .catch(e => console.log(e));

I am using sqlite plugin version -
“cordova-sqlite-storage”: “^5.0.1”,

NOTE - Same code is working fine on Android and iOS device.

Can you elaborate more on exactly what you mean by “Desktop” here? Are you talking about Electron? An app that runs in an ordinary desktop browser environment?

Oh my bad, Yes it is electron.
This app is installable on desktop(windows10).